diff --git a/lib/src/models/config/toolbar/buttons/font_size_configurations.dart b/lib/src/models/config/toolbar/buttons/font_size_configurations.dart index efd31e6e..f4f901ee 100644 --- a/lib/src/models/config/toolbar/buttons/font_size_configurations.dart +++ b/lib/src/models/config/toolbar/buttons/font_size_configurations.dart @@ -50,6 +50,7 @@ class QuillToolbarFontSizeButtonOptions extends QuillToolbarBaseButtonOptions< this.defaultItemColor = Colors.red, super.childBuilder, this.shape, + this.defaultDisplayText, }); final double? iconSize; @@ -70,6 +71,7 @@ class QuillToolbarFontSizeButtonOptions extends QuillToolbarBaseButtonOptions< final double? itemHeight; final EdgeInsets? itemPadding; final Color? defaultItemColor; + final String? defaultDisplayText; QuillToolbarFontSizeButtonOptions copyWith({ double? iconSize, @@ -92,6 +94,7 @@ class QuillToolbarFontSizeButtonOptions extends QuillToolbarBaseButtonOptions< VoidCallback? afterButtonPressed, String? tooltip, OutlinedBorder? shape, + String? defaultDisplayText, }) { return QuillToolbarFontSizeButtonOptions( iconSize: iconSize ?? this.iconSize, @@ -109,6 +112,7 @@ class QuillToolbarFontSizeButtonOptions extends QuillToolbarBaseButtonOptions< defaultItemColor: defaultItemColor ?? this.defaultItemColor, tooltip: tooltip ?? super.tooltip, afterButtonPressed: afterButtonPressed ?? super.afterButtonPressed, + defaultDisplayText: defaultDisplayText ?? this.defaultDisplayText, ); } } diff --git a/lib/src/widgets/toolbar/buttons/font_size_button.dart b/lib/src/widgets/toolbar/buttons/font_size_button.dart index 5ca4b895..8595eae9 100644 --- a/lib/src/widgets/toolbar/buttons/font_size_button.dart +++ b/lib/src/widgets/toolbar/buttons/font_size_button.dart @@ -22,6 +22,7 @@ class QuillToolbarFontSizeButton extends StatefulWidget { final QuillToolbarFontSizeButtonOptions options; + @Deprecated('Please use the default display text from the options') final String defaultDisplayText; /// Since we can't get the state from the instace of the widget for comparing @@ -64,7 +65,10 @@ class QuillToolbarFontSizeButtonState } String get _defaultDisplayText { - return options.initialValue ?? widget.defaultDisplayText; + return options.initialValue ?? + widget.options.defaultDisplayText ?? + // ignore: deprecated_member_use_from_same_package + widget.defaultDisplayText; } @override