mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
feat: support customizing page icon (#3849)
* chore: don't use cache when building release package * feat: refactor icon widget design * feat: sync the emoji between page and view * feat: use cache to store the emoji data to prevent reloading * feat: customize the emoji item builder * feat: add i18n and shuffle emoji button * fix: integration test * feat: replace emoji picker in Grid and slash menu * feat: support adding icon on mobile platform * feat: support adding and removing icon on mobile * test: add integration tests
This commit is contained in:
@ -186,10 +186,9 @@ class _BannerTitleState extends State<_BannerTitle> {
|
||||
controller: widget.popoverController,
|
||||
triggerActions: PopoverTriggerFlags.none,
|
||||
direction: PopoverDirection.bottomWithLeftAligned,
|
||||
constraints: const BoxConstraints(maxWidth: 380, maxHeight: 300),
|
||||
popupBuilder: (popoverContext) => _buildEmojiPicker((emoji) {
|
||||
context
|
||||
.read<RowBannerBloc>()
|
||||
.add(RowBannerEvent.setIcon(emoji.emoji));
|
||||
context.read<RowBannerBloc>().add(RowBannerEvent.setIcon(emoji));
|
||||
widget.popoverController.close();
|
||||
}),
|
||||
child: Row(children: children),
|
||||
@ -199,7 +198,7 @@ class _BannerTitleState extends State<_BannerTitle> {
|
||||
}
|
||||
}
|
||||
|
||||
typedef OnSubmittedEmoji = void Function(Emoji emoji);
|
||||
typedef OnSubmittedEmoji = void Function(String emoji);
|
||||
const _kBannerActionHeight = 40.0;
|
||||
|
||||
class EmojiButton extends StatelessWidget {
|
||||
@ -286,12 +285,9 @@ class RemoveEmojiButton extends StatelessWidget {
|
||||
}
|
||||
|
||||
Widget _buildEmojiPicker(OnSubmittedEmoji onSubmitted) {
|
||||
return SizedBox(
|
||||
height: 250,
|
||||
child: EmojiSelectionMenu(
|
||||
onSubmitted: onSubmitted,
|
||||
onExit: () {},
|
||||
),
|
||||
return EmojiSelectionMenu(
|
||||
onSubmitted: onSubmitted,
|
||||
onExit: () {},
|
||||
);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user