From a809d07bbab4d0236efa258dfb627bb2b23d7a33 Mon Sep 17 00:00:00 2001 From: mark8044 <87546778+mark8044@users.noreply.github.com> Date: Sun, 14 Nov 2021 09:11:00 -0800 Subject: [PATCH] Update select_alignment_button.dart --- lib/src/widgets/toolbar/select_alignment_button.dart | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/src/widgets/toolbar/select_alignment_button.dart b/lib/src/widgets/toolbar/select_alignment_button.dart index 713225ce..eb427caf 100644 --- a/lib/src/widgets/toolbar/select_alignment_button.dart +++ b/lib/src/widgets/toolbar/select_alignment_button.dart @@ -47,27 +47,29 @@ class _SelectAlignmentButtonState extends State { Attribute.leftAlignment: Attribute.leftAlignment.value!, Attribute.centerAlignment: Attribute.centerAlignment.value!, Attribute.rightAlignment: Attribute.rightAlignment.value!, - Attribute.justifyAlignment: Attribute.justifyAlignment.value!, + if (showJustifyAlignment) Attribute.justifyAlignment: Attribute.justifyAlignment.value!, }; final _valueAttribute = [ Attribute.leftAlignment, Attribute.centerAlignment, Attribute.rightAlignment, - Attribute.justifyAlignment + if (showJustifyAlignment) Attribute.justifyAlignment ]; final _valueString = [ Attribute.leftAlignment.value!, Attribute.centerAlignment.value!, Attribute.rightAlignment.value!, - Attribute.justifyAlignment.value!, + if (showJustifyAlignment) Attribute.justifyAlignment.value!, ]; final theme = Theme.of(context); + + final buttonCount = (showJustifyAlignment == true) ? 4 : 3; return Row( mainAxisSize: MainAxisSize.min, - children: List.generate(4, (index) { + children: List.generate(buttonCount, (index) { return Padding( padding: const EdgeInsets.symmetric(horizontal: !kIsWeb ? 1.0 : 5.0), child: ConstrainedBox(