Create a 'Default' category for Font Size which results in no font size styling (#795)

pull/797/head
mark8044 3 years ago committed by GitHub
parent 9a62ee79f9
commit 0f1fcd4799
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      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) &&

Loading…
Cancel
Save