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;
attributes = {
BuildIndependentTargetsInParallel = YES;
LastUpgradeCheck = 1430;
LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "";
TargetAttributes = {
331C8080294A63A400263BE5 = {

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

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

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

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

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

@ -186,7 +186,9 @@ class QuillToolbarFontSizeButtonState
child: Text(
fontSize.key.toString(),
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(e);
},
child: Text(_label(e)),
child: Text(_label(e), style: widget.options.dropdownTextStyle),
),
)
.toList(),

Loading…
Cancel
Save