Update select_alignment_button.dart

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

@ -47,27 +47,29 @@ class _SelectAlignmentButtonState extends State<SelectAlignmentButton> {
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!, Attribute.rightAlignment: Attribute.rightAlignment.value!,
Attribute.justifyAlignment: Attribute.justifyAlignment.value!, if (showJustifyAlignment) Attribute.justifyAlignment: Attribute.justifyAlignment.value!,
}; };
final _valueAttribute = <Attribute>[ final _valueAttribute = <Attribute>[
Attribute.leftAlignment, Attribute.leftAlignment,
Attribute.centerAlignment, Attribute.centerAlignment,
Attribute.rightAlignment, Attribute.rightAlignment,
Attribute.justifyAlignment if (showJustifyAlignment) Attribute.justifyAlignment
]; ];
final _valueString = <String>[ final _valueString = <String>[
Attribute.leftAlignment.value!, Attribute.leftAlignment.value!,
Attribute.centerAlignment.value!, Attribute.centerAlignment.value!,
Attribute.rightAlignment.value!, Attribute.rightAlignment.value!,
Attribute.justifyAlignment.value!, if (showJustifyAlignment) Attribute.justifyAlignment.value!,
]; ];
final theme = Theme.of(context); final theme = Theme.of(context);
final buttonCount = (showJustifyAlignment == true) ? 4 : 3;
return Row( return Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: List.generate(4, (index) { children: List.generate(buttonCount, (index) {
return Padding( return Padding(
padding: const EdgeInsets.symmetric(horizontal: !kIsWeb ? 1.0 : 5.0), padding: const EdgeInsets.symmetric(horizontal: !kIsWeb ? 1.0 : 5.0),
child: ConstrainedBox( child: ConstrainedBox(

Loading…
Cancel
Save