From 278980c6778ac8d658c4a48eae4207ef52e8b59d Mon Sep 17 00:00:00 2001 From: mark8044 <87546778+mark8044@users.noreply.github.com> Date: Sun, 14 Nov 2021 19:33:39 -0800 Subject: [PATCH] Add a new parameter toolBarSectionSpacing to control the toolbar icon Wrap spacing (#461) --- lib/src/widgets/toolbar.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/src/widgets/toolbar.dart b/lib/src/widgets/toolbar.dart index 92ce72a9..947ed255 100644 --- a/lib/src/widgets/toolbar.dart +++ b/lib/src/widgets/toolbar.dart @@ -59,6 +59,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget { const QuillToolbar({ required this.children, this.toolBarHeight = 36, + this.toolBarSectionSpacing, this.color, this.filePickImpl, this.multiRowsDisplay, @@ -69,6 +70,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget { factory QuillToolbar.basic({ required QuillController controller, double toolbarIconSize = kDefaultIconSize, + double toolBarSectionSpacing = 4, bool showBoldButton = true, bool showItalicButton = true, bool showSmallButton = false, @@ -147,6 +149,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget { return QuillToolbar( key: key, toolBarHeight: toolbarIconSize * 2, + toolBarSectionSpacing: toolBarSectionSpacing, multiRowsDisplay: multiRowsDisplay, locale: locale, children: [ @@ -409,6 +412,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget { final List children; final double toolBarHeight; + final double? toolBarSectionSpacing; final bool? multiRowsDisplay; /// The color of the toolbar. @@ -438,7 +442,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget { ? Wrap( alignment: WrapAlignment.center, runSpacing: 4, - spacing: 4, + spacing: toolBarSectionSpacing ?? 4, children: children, ) : Container(