Add `defaultItemColor`

pull/1182/head
BambinoUA 2 years ago
parent d5b075f876
commit fb819027b6
  1. 10
      lib/src/widgets/toolbar/quill_font_family_button.dart
  2. 7
      lib/src/widgets/toolbar/quill_font_size_button.dart

@ -30,6 +30,7 @@ class QuillFontFamilyButton extends StatefulWidget {
this.overrideTooltipByFontFamily = false,
this.itemHeight,
this.itemPadding,
this.defaultItemColor = Colors.red,
Key? key,
}) : assert(rawItemsMap.length > 0),
assert(initialValue == null || initialValue.length > 0),
@ -57,6 +58,7 @@ class QuillFontFamilyButton extends StatefulWidget {
final bool overrideTooltipByFontFamily;
final double? itemHeight;
final EdgeInsets? itemPadding;
final Color? defaultItemColor;
@override
_QuillFontFamilyButtonState createState() => _QuillFontFamilyButtonState();
@ -171,9 +173,11 @@ class _QuillFontFamilyButtonState extends State<QuillFontFamilyButton> {
child: Text(
fontFamily.key.toString(),
style: TextStyle(
fontFamily:
widget.renderFontFamilies ? fontFamily.value : null,
color: fontFamily.value == 'Clear' ? Colors.red : null),
fontFamily: widget.renderFontFamilies ? fontFamily.value : null,
color: fontFamily.value == 'Clear'
? widget.defaultItemColor
: null,
),
),
),
],

@ -29,6 +29,7 @@ class QuillFontSizeButton extends StatefulWidget {
this.labelOverflow = TextOverflow.visible,
this.itemHeight,
this.itemPadding,
this.defaultItemColor = Colors.red,
Key? key,
}) : assert(rawItemsMap.length > 0),
assert(initialValue == null || initialValue.length > 0),
@ -54,6 +55,7 @@ class QuillFontSizeButton extends StatefulWidget {
final TextOverflow labelOverflow;
final double? itemHeight;
final EdgeInsets? itemPadding;
final Color? defaultItemColor;
@override
_QuillFontSizeButtonState createState() => _QuillFontSizeButtonState();
@ -157,8 +159,9 @@ class _QuillFontSizeButtonState extends State<QuillFontSizeButton> {
padding: widget.itemPadding,
child: Text(
fontSize.key.toString(),
style:
TextStyle(color: fontSize.value == '0' ? Colors.red : null),
style: TextStyle(
color: fontSize.value == '0' ? widget.defaultItemColor : null,
),
),
),
],

Loading…
Cancel
Save