Skip to content

Commit 278980c

Browse files
authored
Add a new parameter toolBarSectionSpacing to control the toolbar icon Wrap spacing (singerdmx#461)
1 parent 7e958b6 commit 278980c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/src/widgets/toolbar.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
5959
const QuillToolbar({
6060
required this.children,
6161
this.toolBarHeight = 36,
62+
this.toolBarSectionSpacing,
6263
this.color,
6364
this.filePickImpl,
6465
this.multiRowsDisplay,
@@ -69,6 +70,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
6970
factory QuillToolbar.basic({
7071
required QuillController controller,
7172
double toolbarIconSize = kDefaultIconSize,
73+
double toolBarSectionSpacing = 4,
7274
bool showBoldButton = true,
7375
bool showItalicButton = true,
7476
bool showSmallButton = false,
@@ -147,6 +149,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
147149
return QuillToolbar(
148150
key: key,
149151
toolBarHeight: toolbarIconSize * 2,
152+
toolBarSectionSpacing: toolBarSectionSpacing,
150153
multiRowsDisplay: multiRowsDisplay,
151154
locale: locale,
152155
children: [
@@ -409,6 +412,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
409412

410413
final List<Widget> children;
411414
final double toolBarHeight;
415+
final double? toolBarSectionSpacing;
412416
final bool? multiRowsDisplay;
413417

414418
/// The color of the toolbar.
@@ -438,7 +442,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
438442
? Wrap(
439443
alignment: WrapAlignment.center,
440444
runSpacing: 4,
441-
spacing: 4,
445+
spacing: toolBarSectionSpacing ?? 4,
442446
children: children,
443447
)
444448
: Container(

0 commit comments

Comments
 (0)