|
@@ -35,15 +35,15 @@ class _FlowyHeaderStyleButtonState extends State<FlowyHeaderStyleButton> {
|
|
|
|
|
|
@override
|
|
|
Widget build(BuildContext context) {
|
|
|
- final _valueToText = <Attribute, String>{
|
|
|
+ final valueToText = <Attribute, String>{
|
|
|
Attribute.h1: 'H1',
|
|
|
Attribute.h2: 'H2',
|
|
|
Attribute.h3: 'H3',
|
|
|
};
|
|
|
|
|
|
- final _valueAttribute = <Attribute>[Attribute.h1, Attribute.h2, Attribute.h3];
|
|
|
- final _valueString = <String>['H1', 'H2', 'H3'];
|
|
|
- final _attributeImageName = <String>['editor/H1', 'editor/H2', 'editor/H3'];
|
|
|
+ final valueAttribute = <Attribute>[Attribute.h1, Attribute.h2, Attribute.h3];
|
|
|
+ final valueString = <String>['H1', 'H2', 'H3'];
|
|
|
+ final attributeImageName = <String>['editor/H1', 'editor/H2', 'editor/H3'];
|
|
|
|
|
|
return Row(
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
@@ -52,18 +52,18 @@ class _FlowyHeaderStyleButtonState extends State<FlowyHeaderStyleButton> {
|
|
|
// _valueToText[_value] == _valueString[index] ? svg('editor/H1', color: Colors.white) : svg('editor/H1');
|
|
|
|
|
|
final headerTitle = "${LocaleKeys.toolbar_header.tr()} ${index + 1}";
|
|
|
- final _isToggled = _valueToText[_value] == _valueString[index];
|
|
|
+ final isToggled = valueToText[_value] == valueString[index];
|
|
|
return ToolbarIconButton(
|
|
|
onPressed: () {
|
|
|
- if (_isToggled) {
|
|
|
+ if (isToggled) {
|
|
|
widget.controller.formatSelection(Attribute.header);
|
|
|
} else {
|
|
|
- widget.controller.formatSelection(_valueAttribute[index]);
|
|
|
+ widget.controller.formatSelection(valueAttribute[index]);
|
|
|
}
|
|
|
},
|
|
|
width: widget.iconSize * kIconButtonFactor,
|
|
|
- iconName: _attributeImageName[index],
|
|
|
- isToggled: _isToggled,
|
|
|
+ iconName: attributeImageName[index],
|
|
|
+ isToggled: isToggled,
|
|
|
tooltipText: headerTitle,
|
|
|
);
|
|
|
}),
|