|
|
|
|
@ -7,6 +7,7 @@ import 'package:test_sa/extensions/text_extensions.dart';
|
|
|
|
|
import 'package:test_sa/extensions/widget_extensions.dart';
|
|
|
|
|
import 'package:test_sa/new_views/app_style/app_color.dart';
|
|
|
|
|
import 'package:test_sa/new_views/common_widgets/app_filled_button.dart';
|
|
|
|
|
import 'package:test_sa/views/widgets/item_views/info_header_widget.dart';
|
|
|
|
|
|
|
|
|
|
/// Reusable success dialog for file operations (export, print, etc.)
|
|
|
|
|
class FileSuccessDialog {
|
|
|
|
|
@ -31,47 +32,25 @@ class FileSuccessDialog {
|
|
|
|
|
return Dialog(
|
|
|
|
|
backgroundColor: AppColor.background(context),
|
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
|
borderRadius: BorderRadius.circular(16),
|
|
|
|
|
side: BorderSide(color: AppColor.borderColor(context)),
|
|
|
|
|
borderRadius: BorderRadius.circular(14),
|
|
|
|
|
),
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.all(24.0),
|
|
|
|
|
padding: const EdgeInsets.all(16.0),
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: [
|
|
|
|
|
// Close button
|
|
|
|
|
Align(
|
|
|
|
|
alignment: Alignment.topRight,
|
|
|
|
|
child: 'clear'.toSvgAsset(
|
|
|
|
|
color: AppColor.icon2Color(context),
|
|
|
|
|
width: 18,
|
|
|
|
|
height: 18,
|
|
|
|
|
).onPress(() {
|
|
|
|
|
child: 'clear'.toSvgAsset(color: AppColor.icon2Color(context), width: 18, height: 18).onPress(() {
|
|
|
|
|
Navigator.of(dialogContext).pop();
|
|
|
|
|
}),
|
|
|
|
|
),
|
|
|
|
|
// Success icon
|
|
|
|
|
'done'.toSvgAsset(color: AppColor.green70, width: 56, height: 56),
|
|
|
|
|
const SizedBox(height: 24),
|
|
|
|
|
// Title
|
|
|
|
|
Text(
|
|
|
|
|
title,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 20,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
color: AppColor.headingTextColor(context),
|
|
|
|
|
),
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
),
|
|
|
|
|
title.heading5(context).custom(fontWeight: FontWeight.w600, color: AppColor.textStyleColor(context)),
|
|
|
|
|
const SizedBox(height: 12),
|
|
|
|
|
// Message
|
|
|
|
|
Text(
|
|
|
|
|
message,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 18,
|
|
|
|
|
color: AppColor.lightTextColor(context),
|
|
|
|
|
),
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
),
|
|
|
|
|
message.heading6(context).custom(align: TextAlign.center, fontWeight: FontWeight.w500, color: AppColor.lightTextColor(context)),
|
|
|
|
|
const SizedBox(height: 32),
|
|
|
|
|
// Action buttons
|
|
|
|
|
Row(
|
|
|
|
|
@ -84,8 +63,7 @@ class FileSuccessDialog {
|
|
|
|
|
final result = await OpenFile.open(filePath);
|
|
|
|
|
if (result.type != ResultType.done) {
|
|
|
|
|
log('⚠️ Could not open file: ${result.message}');
|
|
|
|
|
'No app found to open this file type. File saved to: $filePath'
|
|
|
|
|
.showToast;
|
|
|
|
|
'No app found to open this file type. File saved to: $filePath'.showToast;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
label: 'Open',
|
|
|
|
|
@ -131,4 +109,3 @@ class FileSuccessDialog {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|