refactor: used simple toast than styled dialog

This commit is contained in:
Sean Riley Hawkins 2022-06-09 10:25:38 +02:00
parent 86150ec6a1
commit 582733386c
2 changed files with 2 additions and 43 deletions

View File

@ -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);

View File

@ -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),
),
)));
}
}