From 84999db1b2dab06c733a7261e5aef1ef1186a3fb Mon Sep 17 00:00:00 2001 From: mark8044 <87546778+mark8044@users.noreply.github.com> Date: Sun, 14 Nov 2021 21:57:15 -0800 Subject: [PATCH] Update toolbar.dart --- lib/src/widgets/toolbar.dart | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/lib/src/widgets/toolbar.dart b/lib/src/widgets/toolbar.dart index 2e5899d6..0c4518d6 100644 --- a/lib/src/widgets/toolbar.dart +++ b/lib/src/widgets/toolbar.dart @@ -49,8 +49,6 @@ typedef WebVideoPickImpl = Future Function( typedef MediaPickSettingSelector = Future Function( BuildContext context); -enum ToolbarAlignment { start, center, end } - // The default size of the icon of a button. const double kDefaultIconSize = 18; @@ -74,7 +72,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget { required QuillController controller, double toolbarIconSize = kDefaultIconSize, double toolBarSectionSpacing = 4, - ToolbarAlignment toolBarIconAlignment = ToolbarAlignment.center, + WrapAlignment toolBarIconAlignment = WrapAlignment.center, bool showBoldButton = true, bool showItalicButton = true, bool showSmallButton = false, @@ -418,7 +416,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget { final List children; final double toolBarHeight; final double? toolBarSectionSpacing; - final ToolbarAlignment? toolBarIconAlignment; + final WrapAlignment? toolBarIconAlignment; final bool? multiRowsDisplay; /// The color of the toolbar. @@ -446,13 +444,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget { initialLocale: locale, child: multiRowsDisplay ?? true ? Wrap( - alignment: (toolBarIconAlignment == ToolbarAlignment.start) - ? WrapAlignment.start - : (toolBarIconAlignment == ToolbarAlignment.center) - ? WrapAlignment.center - : (toolBarIconAlignment == ToolbarAlignment.end) - ? WrapAlignment.end - : WrapAlignment.center, + alignment: toolBarIconAlignment ?? WrapAlignment.center, runSpacing: 4, spacing: toolBarSectionSpacing ?? 4, children: children,