-
Notifications
You must be signed in to change notification settings - Fork 849
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
Fixes for previous step #1467
Fixes for previous step #1467
Conversation
FYI I won't be able to publish it until 7 hours later |
This is up to you but why not? |
Because I don't have my computer |
Sounds tough, then I will work on the new package more by refactoring things |
I'm using this commit and have a custom tool bar with the following code...
w/o a QuillToolbarProvider - there is an exception.... So I need a Provider, however, the same settings are in the QuillBaseToolbarConfigurations. Do I need the same settings ? |
The QuillToolbarProvider is responsible for providing the toolbar the configurations instance it needs for it children internally |
Example of how it will look like from the end developer perspective: QuillProvider(
configurations: QuillConfigurations(
controller: _controller,
sharedConfigurations: const QuillSharedConfigurations(
locale: Locale('de'),
),
),
child: Column(
children: [
const QuillToolbar(),
Expanded(
child: QuillEditor.basic(
configurations: const QuillEditorConfigurations(
readOnly: false,
),
),
)
],
),
) For creating a custom toolbar with this library support You need to use QuillBaseToolbar and it uses a provider for the QuillToolbarProvider internally so no need for creating a second provider, just the quill provider for shared configurations |
If you are still facing the issue or any others, please let me know |
QuillBaseToolbar throws an exception if no provider is defined above it. |
Do you mean QuillProvider or QuillToolbarProvider?? it only needs QuillProvider |
QuillToolbarProvider. When it's not provided QuillBaseToolbar throws an exception. |
Hi. Can you send me the code snippets to encounter the issue?? |
Because if you are using QuillToolbar or QuillBaseToolbar it already defined internally for you, you don't have to wrap your widget with it |
QuillToolbarProvider_Exception.zip working code / exception code w/diff, exception and stack trace of exception |
Thank you for the report once again, I will checkout soon |
I'm able to encounter the issue, give us some time to debug it and we will see what we can do to fix this issue |
Issue fixed, it require a little adjusments from the library side but there is another issue you are using the buttons of the it should look something like this QuillToolbarProvider(
toolbarConfigurations: const QuillToolbarConfigurations(),
child: QuillBaseToolbar(
configurations: QuillBaseToolbarConfigurations(
toolbarSize: 15 * 2,
multiRowsDisplay: false,
childrenBuilder: (context) {
final controller = context.requireQuillController;
return [
QuillToolbarHistoryButton(
controller: controller,
options: const QuillToolbarHistoryButtonOptions(
isUndo: true),
),
QuillToolbarHistoryButton(
controller: controller,
options: const QuillToolbarHistoryButtonOptions(
isUndo: false),
),
QuillToolbarToggleStyleButton(
attribute: Attribute.bold,
controller: controller,
options: const QuillToolbarToggleStyleButtonOptions(
iconData: Icons.format_bold,
iconSize: 20,
),
),
QuillToolbarToggleStyleButton(
attribute: Attribute.italic,
controller: controller,
options: const QuillToolbarToggleStyleButtonOptions(
iconData: Icons.format_italic,
iconSize: 20,
),
),
QuillToolbarToggleStyleButton(
attribute: Attribute.underline,
controller: controller,
options: const QuillToolbarToggleStyleButtonOptions(
iconData: Icons.format_underline,
iconSize: 20,
),
),
QuillToolbarClearFormatButton(
controller: controller,
options: const QuillToolbarClearFormatButtonOptions(
iconData: Icons.format_clear,
iconSize: 20,
),
),
// if (widget.note.type == UserItemType.note.index)
// PasteButton(
// icon: AppIcons.selectionPaste,
// iconSize: toolbarIconSize,
// controller: controller,
// undo: true,
// ),
VerticalDivider(
indent: 12,
endIndent: 12,
color: Colors.grey.shade400,
),
QuillToolbarSelectHeaderStyleButtons(
controller: controller,
options:
const QuillToolbarSelectHeaderStyleButtonsOptions(
iconSize: 20,
),
),
QuillToolbarToggleStyleButton(
attribute: Attribute.ol,
controller: controller,
options: const QuillToolbarToggleStyleButtonOptions(
iconData: Icons.format_list_numbered,
iconSize: 20,
),
),
QuillToolbarToggleStyleButton(
attribute: Attribute.ul,
controller: controller,
options: const QuillToolbarToggleStyleButtonOptions(
iconData: Icons.format_list_bulleted,
iconSize: 20,
),
),
QuillToolbarToggleStyleButton(
attribute: Attribute.blockQuote,
controller: controller,
options: const QuillToolbarToggleStyleButtonOptions(
iconData: Icons.format_quote,
iconSize: 20,
),
),
VerticalDivider(
indent: 12,
endIndent: 12,
color: Colors.grey.shade400,
),
QuillToolbarIndentButton(
controller: controller,
isIncrease: true,
options: const QuillToolbarIndentButtonOptions(
iconData: Icons.format_indent_increase,
iconSize: 20,
)),
QuillToolbarIndentButton(
controller: controller,
isIncrease: false,
options: const QuillToolbarIndentButtonOptions(
iconData: Icons.format_indent_decrease,
iconSize: 20,
),
),
];
},
),
),
),
|
Also the extension functions for BuildContext is now public after this pull request so you can use final controller = context.requireQuillController; for a little bit better syntax, shorter and cleaner |
Please let me know if you still facing this issue or others |
Working with latest commit thx! |
You are welcome!! |
I will publish it in 30 min |
Important changes for previous steps
this update should be published as it is required for fresh_quill_extensions which will be a temp alternative to flutter_quill_extensions
Also, it's updated some of the old documentation in readme