Jelajahi Sumber

refactor: used simple toast than styled dialog

Sean Riley Hawkins 2 tahun lalu
induk
melakukan
582733386c

+ 2 - 4
frontend/app_flowy/lib/workspace/presentation/plugins/doc/document.dart

@@ -11,6 +11,7 @@ import 'package:app_flowy/workspace/application/appearance.dart';
 import 'package:app_flowy/workspace/application/doc/share_bloc.dart';
 import 'package:app_flowy/workspace/application/view/view_listener.dart';
 import 'package:app_flowy/workspace/presentation/home/home_stack.dart';
+import 'package:app_flowy/workspace/presentation/home/toast.dart';
 import 'package:app_flowy/workspace/presentation/plugins/widgets/left_bar_item.dart';
 import 'package:app_flowy/workspace/presentation/widgets/dialogs.dart';
 import 'package:app_flowy/workspace/presentation/widgets/pop_up_action.dart';
@@ -179,10 +180,7 @@ class DocumentShareButton extends StatelessWidget {
         switch (action) {
           case ShareAction.markdown:
             context.read<DocShareBloc>().add(const DocShareEvent.shareMarkdown());
-            BubbleNotification(
-                    msgTitle: LocaleKeys.notifications_export_markdown.tr(),
-                    msgBody: 'Path: ${LocaleKeys.notifications_export_path.tr()}')
-                .show(context);
+            showMessageToast('Exported to: ${LocaleKeys.notifications_export_path.tr()}');
             break;
           case ShareAction.copyLink:
             FlowyAlertDialog(title: LocaleKeys.shareAction_workInProgress.tr()).show(context);

+ 0 - 39
frontend/app_flowy/lib/workspace/presentation/widgets/dialogs.dart

@@ -219,42 +219,3 @@ class OkCancelButton extends StatelessWidget {
     );
   }
 }
-
-class BubbleNotification extends StatefulWidget {
-  final String msgTitle;
-  final String msgBody;
-
-  const BubbleNotification({Key? key, required this.msgTitle, required this.msgBody}) : super(key: key);
-
-  @override
-  State<BubbleNotification> createState() => _BubbleNotification();
-}
-
-class _BubbleNotification extends State<BubbleNotification> {
-  @override
-  void initState() {
-    super.initState();
-  }
-
-  @override
-  Widget build(BuildContext context) {
-    return StyledDialog(
-        // maxWidth: 800,
-        maxHeight: 200,
-        shrinkWrap: true,
-        child: Card(
-            margin: const EdgeInsets.symmetric(horizontal: 4),
-            child: SafeArea(
-              child: ListTile(
-                leading: SizedBox.fromSize(
-                  size: const Size(40, 40),
-                  child: const ClipOval(
-                    child: Icon(Icons.file_copy),
-                  ),
-                ),
-                title: Text(widget.msgTitle),
-                subtitle: Text(widget.msgBody),
-              ),
-            )));
-  }
-}