-
Notifications
You must be signed in to change notification settings - Fork 210
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
Allow developer to change toolbar color as well as option to show default toolbar items and html to document converter added #58
Conversation
lib/src/service/editor_service.dart
Outdated
@@ -34,6 +34,9 @@ class AppFlowyEditor extends StatefulWidget { | |||
this.autoFocus = false, | |||
this.focusedSelection, | |||
this.customActionMenuBuilder, | |||
this.toolbarColor=const Color(0xFF333333), |
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.
It's not a good idea to add these parameters to editor_service
. Instead, you can refer to editor_style.dart
for guidance.
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.
but inside toolbar widget color is already defined if we did add color inside theme than its always be overridden by the already added color inside Material widget
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.
Hey @alihassan143, please format the code before submitting, |
@LucasXu0 code is formated |
@LucasXu0 CompositedTransformFollower instead of this widget if we use textselectiontoolbar widget and pass childrens to its if the child list grows its adapts automatically to screen width |
@LucasXu0 toolbar elevation and toolbar color now moved to editor style |
lib/appflowy_editor.dart
Outdated
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.
Since you made a barrel file for src/extenstions/...
then you can remove all duplicate exports.
eg. export 'src/extensions/node_extensions.dart';
and export 'src/extensions/attributes_extension.dart';
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.
done
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.
There are still some pieces of code that need to be formatted. You can run dart fix --apply locally to apply the changes.
This PR reminds me that I should split the toolbar function into a plugable feature. The editor and the toolbar should not have a reference to each other, but they can be composed together for use. |
By the way, workflows have not run, but you need to reword all your commits to conform to the commit format. It's a good practice to learn, I was happily surprised when I found out AppFlowy already enforces commit messages the way I prefer them. Honestly I think for you it would be easier if you squashed all your commits into one, and then made the commit message eg. If you want to do the squash, you can do it like this:
If you want to reword each of your commits to conform to the commit lint, you can do:
Then an interactive editor will open, press After. that hit ESC and then write Thus preferring the squash.. EDIT: And of course, when you're done, you need to force push because you changed the history. |
Codecov Report
@@ Coverage Diff @@
## main #58 +/- ##
==========================================
+ Coverage 86.65% 86.67% +0.01%
==========================================
Files 124 124
Lines 7230 7248 +18
==========================================
+ Hits 6265 6282 +17
- Misses 965 966 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
this pr added option to add custom color to toolbar and elevation also exported extension so it can be accessed when adding custom toolbar items