pull/602/head
X Code 3 years ago
parent 689d7de5d9
commit 702bb2a9b9
  1. 12
      lib/src/widgets/toolbar/color_button.dart

@ -37,7 +37,7 @@ class _ColorButtonState extends State<ColorButton> {
late bool _isToggledColor;
late bool _isToggledBackground;
late bool _isWhite;
late bool _isWhitebackground;
late bool _isWhiteBackground;
Style get _selectionStyle => widget.controller.getSelectionStyle();
@ -49,7 +49,7 @@ class _ColorButtonState extends State<ColorButton> {
widget.controller.getSelectionStyle().attributes);
_isWhite = _isToggledColor &&
_selectionStyle.attributes['color']!.value == '#ffffff';
_isWhitebackground = _isToggledBackground &&
_isWhiteBackground = _isToggledBackground &&
_selectionStyle.attributes['background']!.value == '#ffffff';
});
}
@ -61,7 +61,7 @@ class _ColorButtonState extends State<ColorButton> {
_isToggledBackground = _getIsToggledBackground(_selectionStyle.attributes);
_isWhite = _isToggledColor &&
_selectionStyle.attributes['color']!.value == '#ffffff';
_isWhitebackground = _isToggledBackground &&
_isWhiteBackground = _isToggledBackground &&
_selectionStyle.attributes['background']!.value == '#ffffff';
widget.controller.addListener(_didChangeEditingValue);
}
@ -85,7 +85,7 @@ class _ColorButtonState extends State<ColorButton> {
_getIsToggledBackground(_selectionStyle.attributes);
_isWhite = _isToggledColor &&
_selectionStyle.attributes['color']!.value == '#ffffff';
_isWhitebackground = _isToggledBackground &&
_isWhiteBackground = _isToggledBackground &&
_selectionStyle.attributes['background']!.value == '#ffffff';
}
}
@ -104,7 +104,7 @@ class _ColorButtonState extends State<ColorButton> {
: (widget.iconTheme?.iconUnselectedColor ?? theme.iconTheme.color);
final iconColorBackground =
_isToggledBackground && widget.background && !_isWhitebackground
_isToggledBackground && widget.background && !_isWhiteBackground
? stringToColor(_selectionStyle.attributes['background']!.value)
: (widget.iconTheme?.iconUnselectedColor ?? theme.iconTheme.color);
@ -112,7 +112,7 @@ class _ColorButtonState extends State<ColorButton> {
? stringToColor('#ffffff')
: (widget.iconTheme?.iconUnselectedFillColor ?? theme.canvasColor);
final fillColorBackground =
_isToggledBackground && widget.background && _isWhitebackground
_isToggledBackground && widget.background && _isWhiteBackground
? stringToColor('#ffffff')
: (widget.iconTheme?.iconUnselectedFillColor ?? theme.canvasColor);

Loading…
Cancel
Save