diff --git a/lib/src/widgets/toolbar/buttons/font_size_button.dart b/lib/src/widgets/toolbar/buttons/font_size_button.dart index 8595eae9..f844df76 100644 --- a/lib/src/widgets/toolbar/buttons/font_size_button.dart +++ b/lib/src/widgets/toolbar/buttons/font_size_button.dart @@ -13,7 +13,7 @@ import '../base_toolbar.dart'; class QuillToolbarFontSizeButton extends StatefulWidget { QuillToolbarFontSizeButton({ required this.controller, - required this.defaultDisplayText, + this.defaultDisplayText, this.options = const QuillToolbarFontSizeButtonOptions(), super.key, }) : assert(options.rawItemsMap?.isNotEmpty ?? true), @@ -23,7 +23,7 @@ class QuillToolbarFontSizeButton extends StatefulWidget { final QuillToolbarFontSizeButtonOptions options; @Deprecated('Please use the default display text from the options') - final String defaultDisplayText; + final String? defaultDisplayText; /// Since we can't get the state from the instace of the widget for comparing /// in [didUpdateWidget] then we will have to store reference here @@ -68,7 +68,8 @@ class QuillToolbarFontSizeButtonState return options.initialValue ?? widget.options.defaultDisplayText ?? // ignore: deprecated_member_use_from_same_package - widget.defaultDisplayText; + widget.defaultDisplayText ?? + context.loc.fontSize; } @override diff --git a/lib/src/widgets/toolbar/simple_toolbar.dart b/lib/src/widgets/toolbar/simple_toolbar.dart index 43b39577..9fa53093 100644 --- a/lib/src/widgets/toolbar/simple_toolbar.dart +++ b/lib/src/widgets/toolbar/simple_toolbar.dart @@ -83,7 +83,6 @@ class QuillSimpleToolbar extends StatelessWidget QuillToolbarFontSizeButton( options: toolbarConfigurations.buttonOptions.fontSize, controller: globalController, - defaultDisplayText: context.loc.fontSize, ), if (configurations.showBoldButton) QuillToolbarToggleStyleButton(