-
Notifications
You must be signed in to change notification settings - Fork 343
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
Custom style button #81
Comments
Yes you can totally do that! There are two ways;
Which one are you trying to do? I can send an example for that. |
Thanks for your prompt reply |
Sorry for the late response. Here is how to do that: bool isBold = false;
IconButton(
icon: Icon(Icons.format_bold, color: isBold ? Colors.blue : Colors.black),
onPressed: () => controller.execCommand('bold'),
);
HtmlEditor(
htmlToolbarOptions: HtmlToolbarOptions(
defaultToolbarButtons: [
//add buttons here, but remove the bold button because you have a custom one. See README for more details
]
),
callbacks: Callbacks(
onChangeSelection: (EditorSettings settings) => setState(() { isBold = settings.isBold }),
)
); It isn't super difficult. You can use the same approach for any other button or dropdown. Let me know if you have any issues or other questions. |
@alirezaemami I hope the above code was helpful. Closing for now, let me know if you have any other questions. |
I want to use my own custom buttons to bold a word.
Is there a way to change the style of the selected words (without using the toolbar)?
The text was updated successfully, but these errors were encountered: