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: add custom icons for callout (#7449)

Mornc1612fe29839
diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/base/emoji_picker_button.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/base/emoji_picker_button.dart
index e25710c137..93b45cf46a 100644
--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/base/emoji_picker_button.dart
+++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/base/emoji_picker_button.dart
@@ -208,7 +208,7 @@ class _MobileEmojiPickerButton extends StatelessWidget {
MobileEmojiPickerScreen.iconSelectedType: emoji.type.name,
MobileEmojiPickerScreen.uploadDocumentId: documentId,
MobileEmojiPickerScreen.selectTabs:
- tabs.map((e) => e.name).toList(),
+ tabs.map((e) => e.name).toList().join('-'),
},
).toString(),
);
diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/callout/callout_block_component.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/callout/callout_block_component.dart
index 45a5a93ac8..7865d8e13c 100644
--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/callout/callout_block_component.dart
+++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/callout/callout_block_component.dart
@@ -1,6 +1,8 @@
import 'package:appflowy/generated/locale_keys.g.dart' show LocaleKeys;
import 'package:appflowy/generated/locale_keys.g.dart';
+import 'package:appflowy/plugins/document/application/document_bloc.dart';
import 'package:appflowy/shared/icon_emoji_picker/flowy_icon_emoji_picker.dart';
+import 'package:appflowy/shared/icon_emoji_picker/tab.dart';
import 'package:appflowy_backend/log.dart';
import 'package:appflowy_editor/appflowy_editor.dart';
import 'package:easy_localization/easy_localization.dart'
@@ -217,7 +219,7 @@ class _CalloutBlockComponentWidgetState
layoutDirection: Directionality.maybeOf(context),
);
final (emojiSize, emojiButtonSize) = calculateEmojiSize();
-
+ final documentId = context.read<DocumentBloc?>()?.documentId;
Widget child = Container(
decoration: BoxDecoration(
borderRadius: const BorderRadius.all(Radius.circular(6.0)),
@@ -227,7 +229,6 @@ class _CalloutBlockComponentWidgetState
width: double.infinity,
alignment: alignment,
child: Row(
- crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
textDirection: textDirection,
children: [
@@ -245,6 +246,12 @@ class _CalloutBlockComponentWidgetState
emojiSize: emojiSize,
showBorder: false,
buttonSize: emojiButtonSize,
+ documentId: documentId,
+ tabs: const [
+ PickerTabType.emoji,
+ PickerTabType.icon,
+ PickerTabType.custom,
+ ],
onSubmitted: (r, controller) {
setEmojiIconData(r.data);
if (!r.keepOpen) controller?.close();