Add options to style the color of the dropdown menu items for FontSize, FontFamily, and HeaderStyle in the QuillToolbar

pull/1794/head
MK 1 year ago
parent 05c17e1ebc
commit 38b4233efc
No known key found for this signature in database
GPG Key ID: 7DBFD12F614487C
  1. 2
      example/ios/Runner.xcodeproj/project.pbxproj
  2. 2
      example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
  3. 2
      lib/src/models/config/toolbar/buttons/font_family_configurations.dart
  4. 2
      lib/src/models/config/toolbar/buttons/font_size_configurations.dart
  5. 2
      lib/src/models/config/toolbar/buttons/select_header_style_dropdown_button_configurations.dart
  6. 2
      lib/src/widgets/toolbar/buttons/font_family_button.dart
  7. 4
      lib/src/widgets/toolbar/buttons/font_size_button.dart
  8. 2
      lib/src/widgets/toolbar/buttons/hearder_style/select_header_style_dropdown_button.dart

@ -216,7 +216,7 @@
isa = PBXProject; isa = PBXProject;
attributes = { attributes = {
BuildIndependentTargetsInParallel = YES; BuildIndependentTargetsInParallel = YES;
LastUpgradeCheck = 1430; LastUpgradeCheck = 1510;
ORGANIZATIONNAME = ""; ORGANIZATIONNAME = "";
TargetAttributes = { TargetAttributes = {
331C8080294A63A400263BE5 = { 331C8080294A63A400263BE5 = {

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Scheme <Scheme
LastUpgradeVersion = "1430" LastUpgradeVersion = "1510"
version = "1.3"> version = "1.3">
<BuildAction <BuildAction
parallelizeBuildables = "YES" parallelizeBuildables = "YES"

@ -48,6 +48,7 @@ class QuillToolbarFontFamilyButtonOptions extends QuillToolbarBaseButtonOptions<
this.itemHeight, this.itemHeight,
this.itemPadding, this.itemPadding,
this.defaultItemColor = Colors.red, this.defaultItemColor = Colors.red,
this.dropdownTextColor,
this.renderFontFamilies = true, this.renderFontFamilies = true,
super.iconSize, super.iconSize,
super.iconButtonFactor, super.iconButtonFactor,
@ -70,6 +71,7 @@ class QuillToolbarFontFamilyButtonOptions extends QuillToolbarBaseButtonOptions<
final double? itemHeight; final double? itemHeight;
final EdgeInsets? itemPadding; final EdgeInsets? itemPadding;
final Color? defaultItemColor; final Color? defaultItemColor;
final Color? dropdownTextColor;
final String? defaultDisplayText; final String? defaultDisplayText;
QuillToolbarFontFamilyButtonOptions copyWith({ QuillToolbarFontFamilyButtonOptions copyWith({

@ -48,6 +48,7 @@ class QuillToolbarFontSizeButtonOptions extends QuillToolbarBaseButtonOptions<
this.itemHeight, this.itemHeight,
this.itemPadding, this.itemPadding,
this.defaultItemColor = Colors.red, this.defaultItemColor = Colors.red,
this.dropdownTextColor,
super.childBuilder, super.childBuilder,
this.shape, this.shape,
this.defaultDisplayText, this.defaultDisplayText,
@ -70,6 +71,7 @@ class QuillToolbarFontSizeButtonOptions extends QuillToolbarBaseButtonOptions<
@Deprecated('No longer used') @Deprecated('No longer used')
final EdgeInsets? itemPadding; final EdgeInsets? itemPadding;
final Color? defaultItemColor; final Color? defaultItemColor;
final Color? dropdownTextColor;
final String? defaultDisplayText; final String? defaultDisplayText;
QuillToolbarFontSizeButtonOptions copyWith({ QuillToolbarFontSizeButtonOptions copyWith({

@ -28,6 +28,7 @@ class QuillToolbarSelectHeaderStyleDropdownButtonOptions
super.iconSize, super.iconSize,
super.iconButtonFactor, super.iconButtonFactor,
this.textStyle, this.textStyle,
this.dropdownTextStyle,
super.iconData, super.iconData,
this.attributes, this.attributes,
this.defaultDisplayText, this.defaultDisplayText,
@ -35,6 +36,7 @@ class QuillToolbarSelectHeaderStyleDropdownButtonOptions
}); });
final TextStyle? textStyle; final TextStyle? textStyle;
final TextStyle? dropdownTextStyle;
/// Header attributes, defaults to: /// Header attributes, defaults to:
/// ```dart /// ```dart

@ -217,7 +217,7 @@ class QuillToolbarFontFamilyButtonState
options.renderFontFamilies ? fontFamily.value : null, options.renderFontFamilies ? fontFamily.value : null,
color: fontFamily.value == 'Clear' color: fontFamily.value == 'Clear'
? options.defaultItemColor ? options.defaultItemColor
: null, : options.dropdownTextColor,
), ),
), ),
), ),

@ -186,7 +186,9 @@ class QuillToolbarFontSizeButtonState
child: Text( child: Text(
fontSize.key.toString(), fontSize.key.toString(),
style: TextStyle( style: TextStyle(
color: fontSize.value == '0' ? options.defaultItemColor : null, color: fontSize.value == '0'
? options.defaultItemColor
: options.dropdownTextColor,
), ),
), ),
); );

@ -164,7 +164,7 @@ class _QuillToolbarSelectHeaderStyleDropdownButtonState
onPressed: () { onPressed: () {
_onPressed(e); _onPressed(e);
}, },
child: Text(_label(e)), child: Text(_label(e), style: widget.options.dropdownTextStyle),
), ),
) )
.toList(), .toList(),

Loading…
Cancel
Save