mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
refactor: used simple toast than styled dialog
This commit is contained in:
parent
86150ec6a1
commit
582733386c
@ -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);
|
||||
|
@ -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),
|
||||
),
|
||||
)));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user