From 5eb122712bc612a6a7777b4ebb7b1a44238b0099 Mon Sep 17 00:00:00 2001 From: Adil Hanney Date: Thu, 9 Nov 2023 02:32:17 +0000 Subject: [PATCH] fix: fix runtime errors --- lib/src/models/config/toolbar/buttons/clear_format.dart | 2 ++ lib/src/models/config/toolbar/buttons/color.dart | 2 ++ lib/src/models/config/toolbar/buttons/history.dart | 2 ++ lib/src/models/config/toolbar/buttons/indent.dart | 2 ++ lib/src/models/config/toolbar/buttons/link_style.dart | 2 ++ lib/src/models/config/toolbar/buttons/link_style2.dart | 2 ++ lib/src/models/config/toolbar/buttons/search.dart | 2 ++ .../models/config/toolbar/buttons/select_alignment.dart | 2 ++ .../config/toolbar/buttons/select_header_style.dart | 2 ++ .../models/config/toolbar/buttons/toggle_check_list.dart | 2 ++ lib/src/models/config/toolbar/buttons/toggle_style.dart | 2 ++ lib/src/widgets/toolbar/buttons/clear_format.dart | 2 +- lib/src/widgets/toolbar/buttons/color.dart | 2 +- lib/src/widgets/toolbar/buttons/history.dart | 2 +- lib/src/widgets/toolbar/buttons/indent.dart | 2 +- lib/src/widgets/toolbar/buttons/link_style.dart | 2 +- lib/src/widgets/toolbar/buttons/link_style2.dart | 2 +- lib/src/widgets/toolbar/buttons/search/search.dart | 2 +- lib/src/widgets/toolbar/buttons/select_alignment.dart | 2 +- lib/src/widgets/toolbar/buttons/select_header_style.dart | 2 +- lib/src/widgets/toolbar/buttons/toggle_check_list.dart | 7 +++++++ lib/src/widgets/toolbar/buttons/toggle_style.dart | 8 ++++++++ 22 files changed, 46 insertions(+), 9 deletions(-) diff --git a/lib/src/models/config/toolbar/buttons/clear_format.dart b/lib/src/models/config/toolbar/buttons/clear_format.dart index f38dd52f..d34eef84 100644 --- a/lib/src/models/config/toolbar/buttons/clear_format.dart +++ b/lib/src/models/config/toolbar/buttons/clear_format.dart @@ -20,7 +20,9 @@ class QuillToolbarClearFormatButtonOptions super.iconTheme, super.tooltip, this.iconSize, + this.iconButtonFactor, }); final double? iconSize; + final double? iconButtonFactor; } diff --git a/lib/src/models/config/toolbar/buttons/color.dart b/lib/src/models/config/toolbar/buttons/color.dart index 19bac781..bff832e8 100644 --- a/lib/src/models/config/toolbar/buttons/color.dart +++ b/lib/src/models/config/toolbar/buttons/color.dart @@ -26,6 +26,7 @@ class QuillToolbarColorButtonOptions extends QuillToolbarBaseButtonOptions< const QuillToolbarColorButtonOptions({ this.dialogBarrierColor, this.iconSize, + this.iconButtonFactor, super.iconData, super.afterButtonPressed, super.childBuilder, @@ -36,6 +37,7 @@ class QuillToolbarColorButtonOptions extends QuillToolbarBaseButtonOptions< }); final double? iconSize; + final double? iconButtonFactor; /// By default will use the default `dialogBarrierColor` from /// [QuillSharedConfigurations] diff --git a/lib/src/models/config/toolbar/buttons/history.dart b/lib/src/models/config/toolbar/buttons/history.dart index eeceeda5..1f1bfaab 100644 --- a/lib/src/models/config/toolbar/buttons/history.dart +++ b/lib/src/models/config/toolbar/buttons/history.dart @@ -28,6 +28,7 @@ class QuillToolbarHistoryButtonOptions extends QuillToolbarBaseButtonOptions< super.tooltip, super.childBuilder, this.iconSize, + this.iconButtonFactor, }); /// If this true then it will be the undo button @@ -36,4 +37,5 @@ class QuillToolbarHistoryButtonOptions extends QuillToolbarBaseButtonOptions< /// By default will use [globalIconSize] final double? iconSize; + final double? iconButtonFactor; } diff --git a/lib/src/models/config/toolbar/buttons/indent.dart b/lib/src/models/config/toolbar/buttons/indent.dart index 30252088..66700c71 100644 --- a/lib/src/models/config/toolbar/buttons/indent.dart +++ b/lib/src/models/config/toolbar/buttons/indent.dart @@ -21,7 +21,9 @@ class QuillToolbarIndentButtonOptions extends QuillToolbarBaseButtonOptions { super.iconTheme, super.tooltip, this.iconSize, + this.iconButtonFactor, }); final double? iconSize; + final double? iconButtonFactor; } diff --git a/lib/src/models/config/toolbar/buttons/link_style.dart b/lib/src/models/config/toolbar/buttons/link_style.dart index 7e2b6717..e82d750e 100644 --- a/lib/src/models/config/toolbar/buttons/link_style.dart +++ b/lib/src/models/config/toolbar/buttons/link_style.dart @@ -22,6 +22,7 @@ class QuillToolbarLinkStyleButtonOptions extends QuillToolbarBaseButtonOptions< this.linkDialogAction, this.dialogBarrierColor, this.iconSize, + this.iconButtonFactor, super.iconData, super.globalIconSize, super.afterButtonPressed, @@ -32,6 +33,7 @@ class QuillToolbarLinkStyleButtonOptions extends QuillToolbarBaseButtonOptions< }); final double? iconSize; + final double? iconButtonFactor; final QuillDialogTheme? dialogTheme; final RegExp? linkRegExp; final LinkDialogAction? linkDialogAction; diff --git a/lib/src/models/config/toolbar/buttons/link_style2.dart b/lib/src/models/config/toolbar/buttons/link_style2.dart index d42eec96..75014143 100644 --- a/lib/src/models/config/toolbar/buttons/link_style2.dart +++ b/lib/src/models/config/toolbar/buttons/link_style2.dart @@ -17,6 +17,7 @@ class QuillToolbarLinkStyleButton2Options extends QuillToolbarBaseButtonOptions< QuillToolbarLinkStyleButton2ExtraOptions> { const QuillToolbarLinkStyleButton2Options({ this.iconSize, + this.iconButtonFactor, this.dialogTheme, this.constraints, this.addLinkLabel, @@ -36,6 +37,7 @@ class QuillToolbarLinkStyleButton2Options extends QuillToolbarBaseButtonOptions< }); final double? iconSize; + final double? iconButtonFactor; final QuillDialogTheme? dialogTheme; /// The constrains for dialog. diff --git a/lib/src/models/config/toolbar/buttons/search.dart b/lib/src/models/config/toolbar/buttons/search.dart index b4505408..6ba95f07 100644 --- a/lib/src/models/config/toolbar/buttons/search.dart +++ b/lib/src/models/config/toolbar/buttons/search.dart @@ -21,6 +21,7 @@ class QuillToolbarSearchButtonOptions extends QuillToolbarBaseButtonOptions { super.iconTheme, this.dialogTheme, this.iconSize, + this.iconButtonFactor, this.dialogBarrierColor, this.fillColor, this.customOnPressedCallback, @@ -28,6 +29,7 @@ class QuillToolbarSearchButtonOptions extends QuillToolbarBaseButtonOptions { final QuillDialogTheme? dialogTheme; final double? iconSize; + final double? iconButtonFactor; /// By default will be [dialogBarrierColor] from [QuillSharedConfigurations] final Color? dialogBarrierColor; diff --git a/lib/src/models/config/toolbar/buttons/select_alignment.dart b/lib/src/models/config/toolbar/buttons/select_alignment.dart index 19bb21bd..0a90d350 100644 --- a/lib/src/models/config/toolbar/buttons/select_alignment.dart +++ b/lib/src/models/config/toolbar/buttons/select_alignment.dart @@ -18,6 +18,7 @@ class QuillToolbarSelectAlignmentButtonOptions this.iconsData, this.tooltips, this.iconSize, + this.iconButtonFactor, super.afterButtonPressed, /// This will called on every select alignment button @@ -26,6 +27,7 @@ class QuillToolbarSelectAlignmentButtonOptions super.iconTheme, }); final double? iconSize; + final double? iconButtonFactor; /// Default to /// const QuillToolbarSelectAlignmentValues( diff --git a/lib/src/models/config/toolbar/buttons/select_header_style.dart b/lib/src/models/config/toolbar/buttons/select_header_style.dart index fd4298b7..6e70c9eb 100644 --- a/lib/src/models/config/toolbar/buttons/select_header_style.dart +++ b/lib/src/models/config/toolbar/buttons/select_header_style.dart @@ -25,6 +25,7 @@ class QuillToolbarSelectHeaderStyleButtonsOptions this.axis, this.attributes, this.iconSize, + this.iconButtonFactor, }); /// Default value: @@ -39,4 +40,5 @@ class QuillToolbarSelectHeaderStyleButtonsOptions /// By default we will the toolbar axis from [QuillToolbarConfigurations] final Axis? axis; final double? iconSize; + final double? iconButtonFactor; } diff --git a/lib/src/models/config/toolbar/buttons/toggle_check_list.dart b/lib/src/models/config/toolbar/buttons/toggle_check_list.dart index 7f4e98b1..54d456b9 100644 --- a/lib/src/models/config/toolbar/buttons/toggle_check_list.dart +++ b/lib/src/models/config/toolbar/buttons/toggle_check_list.dart @@ -22,6 +22,7 @@ class QuillToolbarToggleCheckListButtonOptions QuillToolbarToggleCheckListButtonExtraOptions> { const QuillToolbarToggleCheckListButtonOptions({ this.iconSize, + this.iconButtonFactor, this.fillColor, this.attribute = Attribute.unchecked, this.isShouldRequestKeyboard = false, @@ -34,6 +35,7 @@ class QuillToolbarToggleCheckListButtonOptions }); final double? iconSize; + final double? iconButtonFactor; final Color? fillColor; diff --git a/lib/src/models/config/toolbar/buttons/toggle_style.dart b/lib/src/models/config/toolbar/buttons/toggle_style.dart index 2ad9c1da..2c2ef1dd 100644 --- a/lib/src/models/config/toolbar/buttons/toggle_style.dart +++ b/lib/src/models/config/toolbar/buttons/toggle_style.dart @@ -22,6 +22,7 @@ class QuillToolbarToggleStyleButtonOptions const QuillToolbarToggleStyleButtonOptions({ super.iconData, this.iconSize, + this.iconButtonFactor, this.fillColor, super.tooltip, super.afterButtonPressed, @@ -31,5 +32,6 @@ class QuillToolbarToggleStyleButtonOptions }); final double? iconSize; + final double? iconButtonFactor; final Color? fillColor; } diff --git a/lib/src/widgets/toolbar/buttons/clear_format.dart b/lib/src/widgets/toolbar/buttons/clear_format.dart index aed2feaf..4d9ac51c 100644 --- a/lib/src/widgets/toolbar/buttons/clear_format.dart +++ b/lib/src/widgets/toolbar/buttons/clear_format.dart @@ -28,7 +28,7 @@ class QuillToolbarClearFormatButton extends StatelessWidget { } double _iconButtonFactor(BuildContext context) { - final baseIconFactor = baseButtonExtraOptions(context).iconButtonFactor; + final baseIconFactor = baseButtonExtraOptions(context).globalIconButtonFactor; final iconButtonFactor = options.iconButtonFactor; return iconButtonFactor ?? baseIconFactor; } diff --git a/lib/src/widgets/toolbar/buttons/color.dart b/lib/src/widgets/toolbar/buttons/color.dart index e1804cda..0e4c9e18 100644 --- a/lib/src/widgets/toolbar/buttons/color.dart +++ b/lib/src/widgets/toolbar/buttons/color.dart @@ -109,7 +109,7 @@ class QuillToolbarColorButtonState extends State { } double get iconButtonFactor { - final baseIconFactor = baseButtonExtraOptions.iconButtonFactor; + final baseIconFactor = baseButtonExtraOptions.globalIconButtonFactor; final iconButtonFactor = options.iconButtonFactor; return iconButtonFactor ?? baseIconFactor; } diff --git a/lib/src/widgets/toolbar/buttons/history.dart b/lib/src/widgets/toolbar/buttons/history.dart index 102c8062..089e0769 100644 --- a/lib/src/widgets/toolbar/buttons/history.dart +++ b/lib/src/widgets/toolbar/buttons/history.dart @@ -62,7 +62,7 @@ class QuillToolbarHistoryButtonState extends State { final iconSize = options.iconSize ?? baseButtonConfigurations.globalIconSize; final iconButtonFactor = options.iconButtonFactor ?? - baseButtonConfigurations.iconButtonFactor; + baseButtonConfigurations.globalIconButtonFactor; final iconTheme = options.iconTheme ?? baseButtonConfigurations.iconTheme; final afterButtonPressed = options.afterButtonPressed ?? diff --git a/lib/src/widgets/toolbar/buttons/indent.dart b/lib/src/widgets/toolbar/buttons/indent.dart index 1acaa04c..6c5561c5 100644 --- a/lib/src/widgets/toolbar/buttons/indent.dart +++ b/lib/src/widgets/toolbar/buttons/indent.dart @@ -43,7 +43,7 @@ class QuillToolbarIndentButtonState extends State { } double get iconButtonFactor { - final baseIconFactor = baseButtonExtraOptions.iconButtonFactor; + final baseIconFactor = baseButtonExtraOptions.globalIconButtonFactor; final iconButtonFactor = options.iconButtonFactor; return iconButtonFactor ?? baseIconFactor; } diff --git a/lib/src/widgets/toolbar/buttons/link_style.dart b/lib/src/widgets/toolbar/buttons/link_style.dart index e301ebf2..e96aabb8 100644 --- a/lib/src/widgets/toolbar/buttons/link_style.dart +++ b/lib/src/widgets/toolbar/buttons/link_style.dart @@ -68,7 +68,7 @@ class QuillToolbarLinkStyleButtonState } double get iconButtonFactor { - final baseIconFactor = baseButtonExtraOptions.iconButtonFactor; + final baseIconFactor = baseButtonExtraOptions.globalIconButtonFactor; final iconButtonFactor = options.iconButtonFactor; return iconButtonFactor ?? baseIconFactor; } diff --git a/lib/src/widgets/toolbar/buttons/link_style2.dart b/lib/src/widgets/toolbar/buttons/link_style2.dart index 18f81286..0ddf8f2f 100644 --- a/lib/src/widgets/toolbar/buttons/link_style2.dart +++ b/lib/src/widgets/toolbar/buttons/link_style2.dart @@ -76,7 +76,7 @@ class _QuillToolbarLinkStyleButton2State } double get iconButtonFactor { - final baseIconFactor = baseButtonExtraOptions.iconButtonFactor; + final baseIconFactor = baseButtonExtraOptions.globalIconButtonFactor; final iconButtonFactor = options.iconButtonFactor; return iconButtonFactor ?? baseIconFactor; } diff --git a/lib/src/widgets/toolbar/buttons/search/search.dart b/lib/src/widgets/toolbar/buttons/search/search.dart index b263ad6d..7e2e2886 100644 --- a/lib/src/widgets/toolbar/buttons/search/search.dart +++ b/lib/src/widgets/toolbar/buttons/search/search.dart @@ -28,7 +28,7 @@ class QuillToolbarSearchButton extends StatelessWidget { } double _iconButtonFactor(BuildContext context) { - final baseIconFactor = baseButtonExtraOptions(context).iconButtonFactor; + final baseIconFactor = baseButtonExtraOptions(context).globalIconButtonFactor; final iconButtonFactor = options.iconButtonFactor; return iconButtonFactor ?? baseIconFactor; } diff --git a/lib/src/widgets/toolbar/buttons/select_alignment.dart b/lib/src/widgets/toolbar/buttons/select_alignment.dart index b969b115..6104f9a1 100644 --- a/lib/src/widgets/toolbar/buttons/select_alignment.dart +++ b/lib/src/widgets/toolbar/buttons/select_alignment.dart @@ -67,7 +67,7 @@ class QuillToolbarSelectAlignmentButtonState } double get _iconButtonFactor { - final baseIconFactor = baseButtonExtraOptions.iconButtonFactor; + final baseIconFactor = baseButtonExtraOptions.globalIconButtonFactor; final iconButtonFactor = options.iconButtonFactor; return iconButtonFactor ?? baseIconFactor; } diff --git a/lib/src/widgets/toolbar/buttons/select_header_style.dart b/lib/src/widgets/toolbar/buttons/select_header_style.dart index 7f252439..3795d1dd 100644 --- a/lib/src/widgets/toolbar/buttons/select_header_style.dart +++ b/lib/src/widgets/toolbar/buttons/select_header_style.dart @@ -62,7 +62,7 @@ class QuillToolbarSelectHeaderStyleButtonsState } double get iconButtonFactor { - final baseIconFactor = baseButtonExtraOptions.iconButtonFactor; + final baseIconFactor = baseButtonExtraOptions.globalIconButtonFactor; final iconButtonFactor = options.iconButtonFactor; return iconButtonFactor ?? baseIconFactor; } diff --git a/lib/src/widgets/toolbar/buttons/toggle_check_list.dart b/lib/src/widgets/toolbar/buttons/toggle_check_list.dart index b30a2243..18a65aea 100644 --- a/lib/src/widgets/toolbar/buttons/toggle_check_list.dart +++ b/lib/src/widgets/toolbar/buttons/toggle_check_list.dart @@ -93,6 +93,12 @@ class QuillToolbarToggleCheckListButtonState return iconSize ?? baseFontSize; } + double get iconButtonFactor { + final baseIconFactor = baseButtonExtraOptions.globalIconButtonFactor; + final iconButtonFactor = options.iconButtonFactor; + return iconButtonFactor ?? baseIconFactor; + } + VoidCallback? get afterButtonPressed { return options.afterButtonPressed ?? baseButtonExtraOptions.afterButtonPressed; @@ -154,6 +160,7 @@ class QuillToolbarToggleCheckListButtonState _toggleAttribute, afterButtonPressed, iconSize, + iconButtonFactor, iconTheme, ), ); diff --git a/lib/src/widgets/toolbar/buttons/toggle_style.dart b/lib/src/widgets/toolbar/buttons/toggle_style.dart index 8e73226b..f105174c 100644 --- a/lib/src/widgets/toolbar/buttons/toggle_style.dart +++ b/lib/src/widgets/toolbar/buttons/toggle_style.dart @@ -68,6 +68,13 @@ class QuillToolbarToggleStyleButtonState return iconSize ?? baseFontSize; } + double get iconButtonFactor { + final baseIconFactor = + context.requireQuillToolbarBaseButtonOptions.globalIconButtonFactor; + final iconButtonFactor = options.iconButtonFactor; + return iconButtonFactor ?? baseIconFactor; + } + VoidCallback? get afterButtonPressed { return options.afterButtonPressed ?? context.requireQuillToolbarBaseButtonOptions.afterButtonPressed; @@ -159,6 +166,7 @@ class QuillToolbarToggleStyleButtonState _toggleAttribute, options.afterButtonPressed, iconSize, + iconButtonFactor, iconTheme, ), );