Update select_alignment_button.dart

pull/459/head
mark8044 4 years ago committed by GitHub
parent 1ae1175722
commit 630883e0d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      lib/src/widgets/toolbar/select_alignment_button.dart

@ -13,6 +13,7 @@ class SelectAlignmentButton extends StatefulWidget {
this.iconSize = kDefaultIconSize, this.iconSize = kDefaultIconSize,
this.iconTheme, this.iconTheme,
this.showJustifyAlignment, this.showJustifyAlignment,
this.showRightAlignment,
Key? key, Key? key,
}) : super(key: key); }) : super(key: key);
@ -21,6 +22,7 @@ class SelectAlignmentButton extends StatefulWidget {
final QuillIconTheme? iconTheme; final QuillIconTheme? iconTheme;
final bool? showJustifyAlignment; final bool? showJustifyAlignment;
final bool? showRightAlignment;
@override @override
_SelectAlignmentButtonState createState() => _SelectAlignmentButtonState(); _SelectAlignmentButtonState createState() => _SelectAlignmentButtonState();
@ -46,20 +48,20 @@ class _SelectAlignmentButtonState extends State<SelectAlignmentButton> {
final _valueToText = <Attribute, String>{ final _valueToText = <Attribute, String>{
Attribute.leftAlignment: Attribute.leftAlignment.value!, Attribute.leftAlignment: Attribute.leftAlignment.value!,
Attribute.centerAlignment: Attribute.centerAlignment.value!, Attribute.centerAlignment: Attribute.centerAlignment.value!,
Attribute.rightAlignment: Attribute.rightAlignment.value!, if (widget.showRightAlignment!) Attribute.rightAlignment: Attribute.rightAlignment.value!,
if (widget.showJustifyAlignment!) Attribute.justifyAlignment: Attribute.justifyAlignment.value!, if (widget.showJustifyAlignment!) Attribute.justifyAlignment: Attribute.justifyAlignment.value!,
}; };
final _valueAttribute = <Attribute>[ final _valueAttribute = <Attribute>[
Attribute.leftAlignment, Attribute.leftAlignment,
Attribute.centerAlignment, Attribute.centerAlignment,
Attribute.rightAlignment, if (widget.showRightAlignment!) Attribute.rightAlignment,
if (widget.showJustifyAlignment!) Attribute.justifyAlignment if (widget.showJustifyAlignment!) Attribute.justifyAlignment
]; ];
final _valueString = <String>[ final _valueString = <String>[
Attribute.leftAlignment.value!, Attribute.leftAlignment.value!,
Attribute.centerAlignment.value!, Attribute.centerAlignment.value!,
Attribute.rightAlignment.value!, if (widget.showRightAlignment!) Attribute.rightAlignment.value!,
if (widget.showJustifyAlignment!) Attribute.justifyAlignment.value!, if (widget.showJustifyAlignment!) Attribute.justifyAlignment.value!,
]; ];

Loading…
Cancel
Save