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: testing overlay notification

Sean Riley Hawkins41f2ad09dd91
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 5177c93535..f5be9f37af 100644
--- a/frontend/app_flowy/lib/workspace/application/doc/share_bloc.dart
+++ b/frontend/app_flowy/lib/workspace/application/doc/share_bloc.dart
@@ -3,6 +3,7 @@ import 'dart:io';
import 'package:app_flowy/startup/startup.dart';
import 'package:app_flowy/workspace/application/doc/share_service.dart';
import 'package:app_flowy/workspace/application/markdown/delta_markdown.dart';
+import 'package:app_flowy/workspace/presentation/widgets/dialogs.dart';
import 'package:flowy_sdk/protobuf/flowy-text-block/entities.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-folder-data-model/view.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart';
@@ -34,6 +35,8 @@ class DocShareBloc extends Bloc<DocShareEvent, DocShareState> {
});
}
+ bool checkFile = false;
+
ExportData _convertDeltaToMarkdown(ExportData value) {
final result = deltaToMarkdown(value.data);
value.data = result;
@@ -61,11 +64,16 @@ 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/widgets/dialogs.dart b/frontend/app_flowy/lib/workspace/presentation/widgets/dialogs.dart
index 3a5c1c79e5..fda8d37d9c 100644
--- a/frontend/app_flowy/lib/workspace/presentation/widgets/dialogs.dart
+++ b/frontend/app_flowy/lib/workspace/presentation/widgets/dialogs.dart
@@ -14,6 +14,7 @@ import 'package:flowy_infra_ui/widget/dialog/styled_dialogs.dart';
import 'package:textstyle_extensions/textstyle_extensions.dart';
export 'package:flowy_infra_ui/widget/dialog/styled_dialogs.dart';
import 'package:app_flowy/generated/locale_keys.g.dart';
+import 'package:overlay_support/overlay_support.dart';
class TextFieldDialog extends StatefulWidget {
final String value;
@@ -219,3 +220,27 @@ class OkCancelButton extends StatelessWidget {
);
}
}
+
+class BubbleNotification extends StatelessWidget {
+ final String msgTitle;
+ final String msgBody;
+
+ const BubbleNotification({Key? key, required this.msgTitle, required this.msgBody}) : super(key: key);
+
+ @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')
+ ));
+ }
+}