fix: fix runtime errors

pull/1517/head
Adil Hanney 1 year ago committed by X Code
parent 33b8cb2498
commit 5eb122712b
  1. 2
      lib/src/models/config/toolbar/buttons/clear_format.dart
  2. 2
      lib/src/models/config/toolbar/buttons/color.dart
  3. 2
      lib/src/models/config/toolbar/buttons/history.dart
  4. 2
      lib/src/models/config/toolbar/buttons/indent.dart
  5. 2
      lib/src/models/config/toolbar/buttons/link_style.dart
  6. 2
      lib/src/models/config/toolbar/buttons/link_style2.dart
  7. 2
      lib/src/models/config/toolbar/buttons/search.dart
  8. 2
      lib/src/models/config/toolbar/buttons/select_alignment.dart
  9. 2
      lib/src/models/config/toolbar/buttons/select_header_style.dart
  10. 2
      lib/src/models/config/toolbar/buttons/toggle_check_list.dart
  11. 2
      lib/src/models/config/toolbar/buttons/toggle_style.dart
  12. 2
      lib/src/widgets/toolbar/buttons/clear_format.dart
  13. 2
      lib/src/widgets/toolbar/buttons/color.dart
  14. 2
      lib/src/widgets/toolbar/buttons/history.dart
  15. 2
      lib/src/widgets/toolbar/buttons/indent.dart
  16. 2
      lib/src/widgets/toolbar/buttons/link_style.dart
  17. 2
      lib/src/widgets/toolbar/buttons/link_style2.dart
  18. 2
      lib/src/widgets/toolbar/buttons/search/search.dart
  19. 2
      lib/src/widgets/toolbar/buttons/select_alignment.dart
  20. 2
      lib/src/widgets/toolbar/buttons/select_header_style.dart
  21. 7
      lib/src/widgets/toolbar/buttons/toggle_check_list.dart
  22. 8
      lib/src/widgets/toolbar/buttons/toggle_style.dart

@ -20,7 +20,9 @@ class QuillToolbarClearFormatButtonOptions
super.iconTheme, super.iconTheme,
super.tooltip, super.tooltip,
this.iconSize, this.iconSize,
this.iconButtonFactor,
}); });
final double? iconSize; final double? iconSize;
final double? iconButtonFactor;
} }

@ -26,6 +26,7 @@ class QuillToolbarColorButtonOptions extends QuillToolbarBaseButtonOptions<
const QuillToolbarColorButtonOptions({ const QuillToolbarColorButtonOptions({
this.dialogBarrierColor, this.dialogBarrierColor,
this.iconSize, this.iconSize,
this.iconButtonFactor,
super.iconData, super.iconData,
super.afterButtonPressed, super.afterButtonPressed,
super.childBuilder, super.childBuilder,
@ -36,6 +37,7 @@ class QuillToolbarColorButtonOptions extends QuillToolbarBaseButtonOptions<
}); });
final double? iconSize; final double? iconSize;
final double? iconButtonFactor;
/// By default will use the default `dialogBarrierColor` from /// By default will use the default `dialogBarrierColor` from
/// [QuillSharedConfigurations] /// [QuillSharedConfigurations]

@ -28,6 +28,7 @@ class QuillToolbarHistoryButtonOptions extends QuillToolbarBaseButtonOptions<
super.tooltip, super.tooltip,
super.childBuilder, super.childBuilder,
this.iconSize, this.iconSize,
this.iconButtonFactor,
}); });
/// If this true then it will be the undo button /// If this true then it will be the undo button
@ -36,4 +37,5 @@ class QuillToolbarHistoryButtonOptions extends QuillToolbarBaseButtonOptions<
/// By default will use [globalIconSize] /// By default will use [globalIconSize]
final double? iconSize; final double? iconSize;
final double? iconButtonFactor;
} }

@ -21,7 +21,9 @@ class QuillToolbarIndentButtonOptions extends QuillToolbarBaseButtonOptions {
super.iconTheme, super.iconTheme,
super.tooltip, super.tooltip,
this.iconSize, this.iconSize,
this.iconButtonFactor,
}); });
final double? iconSize; final double? iconSize;
final double? iconButtonFactor;
} }

@ -22,6 +22,7 @@ class QuillToolbarLinkStyleButtonOptions extends QuillToolbarBaseButtonOptions<
this.linkDialogAction, this.linkDialogAction,
this.dialogBarrierColor, this.dialogBarrierColor,
this.iconSize, this.iconSize,
this.iconButtonFactor,
super.iconData, super.iconData,
super.globalIconSize, super.globalIconSize,
super.afterButtonPressed, super.afterButtonPressed,
@ -32,6 +33,7 @@ class QuillToolbarLinkStyleButtonOptions extends QuillToolbarBaseButtonOptions<
}); });
final double? iconSize; final double? iconSize;
final double? iconButtonFactor;
final QuillDialogTheme? dialogTheme; final QuillDialogTheme? dialogTheme;
final RegExp? linkRegExp; final RegExp? linkRegExp;
final LinkDialogAction? linkDialogAction; final LinkDialogAction? linkDialogAction;

@ -17,6 +17,7 @@ class QuillToolbarLinkStyleButton2Options extends QuillToolbarBaseButtonOptions<
QuillToolbarLinkStyleButton2ExtraOptions> { QuillToolbarLinkStyleButton2ExtraOptions> {
const QuillToolbarLinkStyleButton2Options({ const QuillToolbarLinkStyleButton2Options({
this.iconSize, this.iconSize,
this.iconButtonFactor,
this.dialogTheme, this.dialogTheme,
this.constraints, this.constraints,
this.addLinkLabel, this.addLinkLabel,
@ -36,6 +37,7 @@ class QuillToolbarLinkStyleButton2Options extends QuillToolbarBaseButtonOptions<
}); });
final double? iconSize; final double? iconSize;
final double? iconButtonFactor;
final QuillDialogTheme? dialogTheme; final QuillDialogTheme? dialogTheme;
/// The constrains for dialog. /// The constrains for dialog.

@ -21,6 +21,7 @@ class QuillToolbarSearchButtonOptions extends QuillToolbarBaseButtonOptions {
super.iconTheme, super.iconTheme,
this.dialogTheme, this.dialogTheme,
this.iconSize, this.iconSize,
this.iconButtonFactor,
this.dialogBarrierColor, this.dialogBarrierColor,
this.fillColor, this.fillColor,
this.customOnPressedCallback, this.customOnPressedCallback,
@ -28,6 +29,7 @@ class QuillToolbarSearchButtonOptions extends QuillToolbarBaseButtonOptions {
final QuillDialogTheme? dialogTheme; final QuillDialogTheme? dialogTheme;
final double? iconSize; final double? iconSize;
final double? iconButtonFactor;
/// By default will be [dialogBarrierColor] from [QuillSharedConfigurations] /// By default will be [dialogBarrierColor] from [QuillSharedConfigurations]
final Color? dialogBarrierColor; final Color? dialogBarrierColor;

@ -18,6 +18,7 @@ class QuillToolbarSelectAlignmentButtonOptions
this.iconsData, this.iconsData,
this.tooltips, this.tooltips,
this.iconSize, this.iconSize,
this.iconButtonFactor,
super.afterButtonPressed, super.afterButtonPressed,
/// This will called on every select alignment button /// This will called on every select alignment button
@ -26,6 +27,7 @@ class QuillToolbarSelectAlignmentButtonOptions
super.iconTheme, super.iconTheme,
}); });
final double? iconSize; final double? iconSize;
final double? iconButtonFactor;
/// Default to /// Default to
/// const QuillToolbarSelectAlignmentValues( /// const QuillToolbarSelectAlignmentValues(

@ -25,6 +25,7 @@ class QuillToolbarSelectHeaderStyleButtonsOptions
this.axis, this.axis,
this.attributes, this.attributes,
this.iconSize, this.iconSize,
this.iconButtonFactor,
}); });
/// Default value: /// Default value:
@ -39,4 +40,5 @@ class QuillToolbarSelectHeaderStyleButtonsOptions
/// By default we will the toolbar axis from [QuillToolbarConfigurations] /// By default we will the toolbar axis from [QuillToolbarConfigurations]
final Axis? axis; final Axis? axis;
final double? iconSize; final double? iconSize;
final double? iconButtonFactor;
} }

@ -22,6 +22,7 @@ class QuillToolbarToggleCheckListButtonOptions
QuillToolbarToggleCheckListButtonExtraOptions> { QuillToolbarToggleCheckListButtonExtraOptions> {
const QuillToolbarToggleCheckListButtonOptions({ const QuillToolbarToggleCheckListButtonOptions({
this.iconSize, this.iconSize,
this.iconButtonFactor,
this.fillColor, this.fillColor,
this.attribute = Attribute.unchecked, this.attribute = Attribute.unchecked,
this.isShouldRequestKeyboard = false, this.isShouldRequestKeyboard = false,
@ -34,6 +35,7 @@ class QuillToolbarToggleCheckListButtonOptions
}); });
final double? iconSize; final double? iconSize;
final double? iconButtonFactor;
final Color? fillColor; final Color? fillColor;

@ -22,6 +22,7 @@ class QuillToolbarToggleStyleButtonOptions
const QuillToolbarToggleStyleButtonOptions({ const QuillToolbarToggleStyleButtonOptions({
super.iconData, super.iconData,
this.iconSize, this.iconSize,
this.iconButtonFactor,
this.fillColor, this.fillColor,
super.tooltip, super.tooltip,
super.afterButtonPressed, super.afterButtonPressed,
@ -31,5 +32,6 @@ class QuillToolbarToggleStyleButtonOptions
}); });
final double? iconSize; final double? iconSize;
final double? iconButtonFactor;
final Color? fillColor; final Color? fillColor;
} }

@ -28,7 +28,7 @@ class QuillToolbarClearFormatButton extends StatelessWidget {
} }
double _iconButtonFactor(BuildContext context) { double _iconButtonFactor(BuildContext context) {
final baseIconFactor = baseButtonExtraOptions(context).iconButtonFactor; final baseIconFactor = baseButtonExtraOptions(context).globalIconButtonFactor;
final iconButtonFactor = options.iconButtonFactor; final iconButtonFactor = options.iconButtonFactor;
return iconButtonFactor ?? baseIconFactor; return iconButtonFactor ?? baseIconFactor;
} }

@ -109,7 +109,7 @@ class QuillToolbarColorButtonState extends State<QuillToolbarColorButton> {
} }
double get iconButtonFactor { double get iconButtonFactor {
final baseIconFactor = baseButtonExtraOptions.iconButtonFactor; final baseIconFactor = baseButtonExtraOptions.globalIconButtonFactor;
final iconButtonFactor = options.iconButtonFactor; final iconButtonFactor = options.iconButtonFactor;
return iconButtonFactor ?? baseIconFactor; return iconButtonFactor ?? baseIconFactor;
} }

@ -62,7 +62,7 @@ class QuillToolbarHistoryButtonState extends State<QuillToolbarHistoryButton> {
final iconSize = options.iconSize ?? final iconSize = options.iconSize ??
baseButtonConfigurations.globalIconSize; baseButtonConfigurations.globalIconSize;
final iconButtonFactor = options.iconButtonFactor ?? final iconButtonFactor = options.iconButtonFactor ??
baseButtonConfigurations.iconButtonFactor; baseButtonConfigurations.globalIconButtonFactor;
final iconTheme = options.iconTheme ?? baseButtonConfigurations.iconTheme; final iconTheme = options.iconTheme ?? baseButtonConfigurations.iconTheme;
final afterButtonPressed = options.afterButtonPressed ?? final afterButtonPressed = options.afterButtonPressed ??

@ -43,7 +43,7 @@ class QuillToolbarIndentButtonState extends State<QuillToolbarIndentButton> {
} }
double get iconButtonFactor { double get iconButtonFactor {
final baseIconFactor = baseButtonExtraOptions.iconButtonFactor; final baseIconFactor = baseButtonExtraOptions.globalIconButtonFactor;
final iconButtonFactor = options.iconButtonFactor; final iconButtonFactor = options.iconButtonFactor;
return iconButtonFactor ?? baseIconFactor; return iconButtonFactor ?? baseIconFactor;
} }

@ -68,7 +68,7 @@ class QuillToolbarLinkStyleButtonState
} }
double get iconButtonFactor { double get iconButtonFactor {
final baseIconFactor = baseButtonExtraOptions.iconButtonFactor; final baseIconFactor = baseButtonExtraOptions.globalIconButtonFactor;
final iconButtonFactor = options.iconButtonFactor; final iconButtonFactor = options.iconButtonFactor;
return iconButtonFactor ?? baseIconFactor; return iconButtonFactor ?? baseIconFactor;
} }

@ -76,7 +76,7 @@ class _QuillToolbarLinkStyleButton2State
} }
double get iconButtonFactor { double get iconButtonFactor {
final baseIconFactor = baseButtonExtraOptions.iconButtonFactor; final baseIconFactor = baseButtonExtraOptions.globalIconButtonFactor;
final iconButtonFactor = options.iconButtonFactor; final iconButtonFactor = options.iconButtonFactor;
return iconButtonFactor ?? baseIconFactor; return iconButtonFactor ?? baseIconFactor;
} }

@ -28,7 +28,7 @@ class QuillToolbarSearchButton extends StatelessWidget {
} }
double _iconButtonFactor(BuildContext context) { double _iconButtonFactor(BuildContext context) {
final baseIconFactor = baseButtonExtraOptions(context).iconButtonFactor; final baseIconFactor = baseButtonExtraOptions(context).globalIconButtonFactor;
final iconButtonFactor = options.iconButtonFactor; final iconButtonFactor = options.iconButtonFactor;
return iconButtonFactor ?? baseIconFactor; return iconButtonFactor ?? baseIconFactor;
} }

@ -67,7 +67,7 @@ class QuillToolbarSelectAlignmentButtonState
} }
double get _iconButtonFactor { double get _iconButtonFactor {
final baseIconFactor = baseButtonExtraOptions.iconButtonFactor; final baseIconFactor = baseButtonExtraOptions.globalIconButtonFactor;
final iconButtonFactor = options.iconButtonFactor; final iconButtonFactor = options.iconButtonFactor;
return iconButtonFactor ?? baseIconFactor; return iconButtonFactor ?? baseIconFactor;
} }

@ -62,7 +62,7 @@ class QuillToolbarSelectHeaderStyleButtonsState
} }
double get iconButtonFactor { double get iconButtonFactor {
final baseIconFactor = baseButtonExtraOptions.iconButtonFactor; final baseIconFactor = baseButtonExtraOptions.globalIconButtonFactor;
final iconButtonFactor = options.iconButtonFactor; final iconButtonFactor = options.iconButtonFactor;
return iconButtonFactor ?? baseIconFactor; return iconButtonFactor ?? baseIconFactor;
} }

@ -93,6 +93,12 @@ class QuillToolbarToggleCheckListButtonState
return iconSize ?? baseFontSize; return iconSize ?? baseFontSize;
} }
double get iconButtonFactor {
final baseIconFactor = baseButtonExtraOptions.globalIconButtonFactor;
final iconButtonFactor = options.iconButtonFactor;
return iconButtonFactor ?? baseIconFactor;
}
VoidCallback? get afterButtonPressed { VoidCallback? get afterButtonPressed {
return options.afterButtonPressed ?? return options.afterButtonPressed ??
baseButtonExtraOptions.afterButtonPressed; baseButtonExtraOptions.afterButtonPressed;
@ -154,6 +160,7 @@ class QuillToolbarToggleCheckListButtonState
_toggleAttribute, _toggleAttribute,
afterButtonPressed, afterButtonPressed,
iconSize, iconSize,
iconButtonFactor,
iconTheme, iconTheme,
), ),
); );

@ -68,6 +68,13 @@ class QuillToolbarToggleStyleButtonState
return iconSize ?? baseFontSize; return iconSize ?? baseFontSize;
} }
double get iconButtonFactor {
final baseIconFactor =
context.requireQuillToolbarBaseButtonOptions.globalIconButtonFactor;
final iconButtonFactor = options.iconButtonFactor;
return iconButtonFactor ?? baseIconFactor;
}
VoidCallback? get afterButtonPressed { VoidCallback? get afterButtonPressed {
return options.afterButtonPressed ?? return options.afterButtonPressed ??
context.requireQuillToolbarBaseButtonOptions.afterButtonPressed; context.requireQuillToolbarBaseButtonOptions.afterButtonPressed;
@ -159,6 +166,7 @@ class QuillToolbarToggleStyleButtonState
_toggleAttribute, _toggleAttribute,
options.afterButtonPressed, options.afterButtonPressed,
iconSize, iconSize,
iconButtonFactor,
iconTheme, iconTheme,
), ),
); );

Loading…
Cancel
Save