From f90bc043b4d56ec3a7a7a2f5ddb64bd181a3369f Mon Sep 17 00:00:00 2001
From: Ellet <ellet@freshplatform.net>
Date: Tue, 26 Dec 2023 16:31:47 +0300
Subject: [PATCH] defaultDisplayText is not required in the font size button
 anymore

---
 lib/src/widgets/toolbar/buttons/font_size_button.dart | 7 ++++---
 lib/src/widgets/toolbar/simple_toolbar.dart           | 1 -
 2 files changed, 4 insertions(+), 4 deletions(-)

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(