From 2db1cc931b8916da76388550af756a67f2995005 Mon Sep 17 00:00:00 2001 From: li3317 Date: Sun, 14 Nov 2021 20:48:43 -0500 Subject: [PATCH] format code --- lib/src/widgets/toolbar.dart | 8 ++++---- .../toolbar/select_alignment_button.dart | 19 +++++++++++++------ 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/lib/src/widgets/toolbar.dart b/lib/src/widgets/toolbar.dart index 1c9a0391..92ce72a9 100644 --- a/lib/src/widgets/toolbar.dart +++ b/lib/src/widgets/toolbar.dart @@ -137,7 +137,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget { showLeftAlignment, showCenterAlignment, showRightAlignment, - showJustifyAlignment, + showJustifyAlignment, showHeaderStyle, showListNumbers || showListBullets || showListCheck || showCodeBlock, showQuote || showIndent, @@ -290,9 +290,9 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget { controller: controller, iconSize: toolbarIconSize, iconTheme: iconTheme, - showLeftAlignment: showLeftAlignment, - showCenterAlignment: showCenterAlignment, - showRightAlignment: showRightAlignment, + showLeftAlignment: showLeftAlignment, + showCenterAlignment: showCenterAlignment, + showRightAlignment: showRightAlignment, showJustifyAlignment: showJustifyAlignment, ), if (isButtonGroupShown[1] && diff --git a/lib/src/widgets/toolbar/select_alignment_button.dart b/lib/src/widgets/toolbar/select_alignment_button.dart index df3abb8b..98eb90ad 100644 --- a/lib/src/widgets/toolbar/select_alignment_button.dart +++ b/lib/src/widgets/toolbar/select_alignment_button.dart @@ -50,10 +50,14 @@ class _SelectAlignmentButtonState extends State { @override Widget build(BuildContext context) { final _valueToText = { - if (widget.showLeftAlignment!) Attribute.leftAlignment: Attribute.leftAlignment.value!, - if (widget.showCenterAlignment!) Attribute.centerAlignment: Attribute.centerAlignment.value!, - if (widget.showRightAlignment!) Attribute.rightAlignment: Attribute.rightAlignment.value!, - if (widget.showJustifyAlignment!) Attribute.justifyAlignment: Attribute.justifyAlignment.value!, + if (widget.showLeftAlignment!) + Attribute.leftAlignment: Attribute.leftAlignment.value!, + if (widget.showCenterAlignment!) + Attribute.centerAlignment: Attribute.centerAlignment.value!, + if (widget.showRightAlignment!) + Attribute.rightAlignment: Attribute.rightAlignment.value!, + if (widget.showJustifyAlignment!) + Attribute.justifyAlignment: Attribute.justifyAlignment.value!, }; final _valueAttribute = [ @@ -70,8 +74,11 @@ class _SelectAlignmentButtonState extends State { ]; final theme = Theme.of(context); - - final buttonCount = ((widget.showLeftAlignment!) ? 1 : 0) + ((widget.showCenterAlignment!) ? 1 : 0) + ((widget.showRightAlignment!) ? 1 : 0) + ((widget.showJustifyAlignment!) ? 1 : 0); + + final buttonCount = ((widget.showLeftAlignment!) ? 1 : 0) + + ((widget.showCenterAlignment!) ? 1 : 0) + + ((widget.showRightAlignment!) ? 1 : 0) + + ((widget.showJustifyAlignment!) ? 1 : 0); return Row( mainAxisSize: MainAxisSize.min,