From 582733386cbb49601050b30b5a35f026d226c800 Mon Sep 17 00:00:00 2001 From: Sean Riley Hawkins Date: Thu, 9 Jun 2022 10:25:38 +0200 Subject: [PATCH] refactor: used simple toast than styled dialog --- .../presentation/plugins/doc/document.dart | 6 +-- .../presentation/widgets/dialogs.dart | 39 ------------------- 2 files changed, 2 insertions(+), 43 deletions(-) diff --git a/frontend/app_flowy/lib/workspace/presentation/plugins/doc/document.dart b/frontend/app_flowy/lib/workspace/presentation/plugins/doc/document.dart index 7c2a47a8c1..f0609df31d 100644 --- a/frontend/app_flowy/lib/workspace/presentation/plugins/doc/document.dart +++ b/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().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); diff --git a/frontend/app_flowy/lib/workspace/presentation/widgets/dialogs.dart b/frontend/app_flowy/lib/workspace/presentation/widgets/dialogs.dart index c17b386df0..3a5c1c79e5 100644 --- a/frontend/app_flowy/lib/workspace/presentation/widgets/dialogs.dart +++ b/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 createState() => _BubbleNotification(); -} - -class _BubbleNotification extends State { - @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), - ), - ))); - } -}