Skip to content

Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.

feat: in app notification bubble

Sean Riley Hawkinsbe103e02faf3
diff --git a/frontend/app_flowy/lib/workspace/application/doc/share_bloc.dart b/frontend/app_flowy/lib/workspace/application/doc/share_bloc.dart
index f5be9f37af..7954521847 100644
--- a/frontend/app_flowy/lib/workspace/application/doc/share_bloc.dart
+++ b/frontend/app_flowy/lib/workspace/application/doc/share_bloc.dart
@@ -35,8 +35,6 @@ class DocShareBloc extends Bloc<DocShareEvent, DocShareState> {
});
}
- bool checkFile = false;
-
ExportData _convertDeltaToMarkdown(ExportData value) {
final result = deltaToMarkdown(value.data);
value.data = result;
@@ -64,16 +62,11 @@ class DocShareBloc extends Bloc<DocShareEvent, DocShareState> {
Future<File> get _localFile async {
final path = await _localPath;
- checkFile = true;
return File('$path/${view.name}.md');
}
Future<File> writeFile(String md) async {
final file = await _localFile;
- if (checkFile)
- BubbleNotification(msgTitle: 'Export To Markdown', msgBody: 'File saved to $file');
- else
- BubbleNotification(msgTitle: 'Failed to write to file', msgBody: '$file');
return file.writeAsString(md);
}
}
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 5dcf744083..be70d7a67f 100644
--- a/frontend/app_flowy/lib/workspace/presentation/plugins/doc/document.dart
+++ b/frontend/app_flowy/lib/workspace/presentation/plugins/doc/document.dart
@@ -179,6 +179,10 @@ class DocumentShareButton extends StatelessWidget {
switch (action) {
case ShareAction.markdown:
context.read<DocShareBloc>().add(const DocShareEvent.shareMarkdown());
+ BubbleNotification(
+ msgTitle: 'Exported Complete ^_^',
+ msgBody: "Check in the flowy folder inside your documents directory")
+ .show(context);
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 fda8d37d9c..52a506db2c 100644
--- a/frontend/app_flowy/lib/workspace/presentation/widgets/dialogs.dart
+++ b/frontend/app_flowy/lib/workspace/presentation/widgets/dialogs.dart
@@ -221,26 +221,41 @@ class OkCancelButton extends StatelessWidget {
}
}
-class BubbleNotification 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 Card(
- margin: const EdgeInsets.symmetric(horizontal: 4),
- child: SafeArea(
- child: ListTile(
- leading: SizedBox.fromSize(
- size: const Size(40, 40),
- // child: ClipOval(child: )
- ),
- title: Text(msgTitle),
- subtitle: Text(msgBody),
- ),
- // title: Text('Action')
- ));
+ 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: ClipOval(
+ child: Icon(Icons.file_copy),
+ ),
+ ),
+ title: Text(widget.msgTitle),
+ subtitle: Text(widget.msgBody),
+ ),
+ )));
}
}