From 0f1fcd4799bfaf265f3cddf0d71ee2ba140e77a4 Mon Sep 17 00:00:00 2001 From: mark8044 <87546778+mark8044@users.noreply.github.com> Date: Fri, 6 May 2022 15:04:10 -0700 Subject: [PATCH] Create a 'Default' category for Font Size which results in no font size styling (#795) --- lib/src/widgets/toolbar.dart | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/src/widgets/toolbar.dart b/lib/src/widgets/toolbar.dart index a53bae78..8d82718f 100644 --- a/lib/src/widgets/toolbar.dart +++ b/lib/src/widgets/toolbar.dart @@ -153,6 +153,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget { //default font size values final fontSizes = fontSizeValues ?? { + 'Default':0, '10': 10, '12': 12, '14': 14, @@ -202,10 +203,15 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget { ), ], onSelected: (newSize) { - if (newSize != null) { + if ((newSize != null) && (newSize as int > 0)) { controller .formatSelection(Attribute.fromKeyValue('size', newSize)); } + if (newSize as int == 0) + { + controller + .formatSelection(Attribute.fromKeyValue('size', null)); + } }, rawitemsmap: fontSizes, initialValue: (initialFontSizeValue != null) &&