From 5e39e5b2be34296d894a7ae9e71281fcd1103ffe Mon Sep 17 00:00:00 2001 From: mark8044 <87546778+mark8044@users.noreply.github.com> Date: Tue, 17 May 2022 19:57:14 -0700 Subject: [PATCH] Allow removing font size attribute from text (#817) --- lib/src/widgets/toolbar.dart | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/src/widgets/toolbar.dart b/lib/src/widgets/toolbar.dart index 981d7196..5efd20d7 100644 --- a/lib/src/widgets/toolbar.dart +++ b/lib/src/widgets/toolbar.dart @@ -198,8 +198,13 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget { ), ], onSelected: (newSize) { - controller.formatSelection( - Attribute.fromKeyValue('size', getFontSize(newSize))); + if (newSize == '0') { + controller + .formatSelection(Attribute.fromKeyValue('size', null)); + } else { + controller.formatSelection( + Attribute.fromKeyValue('size', getFontSize(newSize))); + } }, rawItemsMap: fontSizes, ),