-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: mobile tool bar basic features #161
feat: mobile tool bar basic features #161
Conversation
lib/src/editor/toolbar/mobile/toolbar_items/code_m_toolbar_item.dart
Outdated
Show resolved
Hide resolved
lib/src/editor/toolbar/mobile/toolbar_items/link_m_toolbar_item.dart
Outdated
Show resolved
Hide resolved
4b03aaf
to
4fbe1b3
Compare
- add hasMenu in MToolbarItem - add const size
lib/src/editor/toolbar/mobile/toolbar_items/heading_mobile_toolbar_item.dart
Outdated
Show resolved
Hide resolved
lib/src/editor/toolbar/mobile/toolbar_items/heading_mobile_toolbar_item.dart
Outdated
Show resolved
Hide resolved
lib/src/editor/toolbar/mobile/toolbar_items/heading_mobile_toolbar_item.dart
Show resolved
Hide resolved
lib/src/editor/toolbar/mobile/toolbar_items/heading_mobile_toolbar_item.dart
Outdated
Show resolved
Hide resolved
lib/src/editor/toolbar/mobile/toolbar_items/heading_mobile_toolbar_item.dart
Outdated
Show resolved
Hide resolved
await editorState.formatDelta(selection, { | ||
FlowyRichTextKeys.href: value, | ||
}); | ||
mobileToolbarItemMenuStateKey.currentState?.closeItemMenu(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about passing the state by the itemMenuBuilder callback instead of using mobileToolbarItemMenuKey?
itemMenuBuilder: (editorState, selection, menuState)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lib/src/editor/toolbar/mobile/toolbar_items/link_mobile_toolbar_item.dart
Outdated
Show resolved
Hide resolved
lib/src/editor/toolbar/mobile/toolbar_items/link_mobile_toolbar_item.dart
Outdated
Show resolved
Hide resolved
lib/src/editor/toolbar/mobile/toolbar_items/list_mobile_toolbar_item.dart
Show resolved
Hide resolved
lib/src/editor/toolbar/mobile/toolbar_items/list_mobile_toolbar_item.dart
Outdated
Show resolved
Hide resolved
lib/src/editor/toolbar/mobile/toolbar_items/todo_list_mobile_toolbar_item.dart
Outdated
Show resolved
Hide resolved
lib/src/editor/toolbar/mobile/toolbar_items/todo_list_mobile_toolbar_item.dart
Outdated
Show resolved
Hide resolved
GlobalKey<MobileToolbarItemMenuState> mobileToolbarItemMenuStateKey = | ||
GlobalKey(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try to remove the global key here.
lib/src/editor/toolbar/mobile/utils/mobile_toolbar_item_menu.dart
Outdated
Show resolved
Hide resolved
lib/src/editor/toolbar/mobile/utils/mobile_toolbar_item_menu_btn.dart
Outdated
Show resolved
Hide resolved
LGTM |
1. Build basic structure for toolbar items in mobile.
Currently, there has two types of MobileToolbarItem:
action
andwithMenu
.action
is for the feature which implement directly after click the toolbar Item, like code inline.withMenu
is for the one needs to open a menu then implement features, like textDecorationMobileToolbarItem2. Add the following toolbar items.
When the selection changes,
MobileToolbarWidget
gets rebuilt based on the current/updated selection(all the item menus will be closed).All the testing code of following checked features have been added.
The unchecked features will be add in other PRs in the future.
Same as desktop for now
Some videoshots, like text decoration and code inline
Screen.Recording.2023-06-02.at.11.14.04.AM.mov
Screen.Recording.2023-06-02.at.11.30.03.AM.mov
3. Add
MobileToolbarStyle
asInheritedWidget
to manage all the cosmetic parameters inMobileToolbar
MobileToolbar
, just give the value directly toMobileToolbar
MobileToolbarStyle.of(context)
to access its cosmetic parameters in child widgets.4. Chores:
test/mobile
toolbar/items
totoolbar/desktop/items