@@ -49,6 +49,8 @@ typedef WebVideoPickImpl = Future<String?> Function(
49
49
typedef MediaPickSettingSelector = Future <MediaPickSetting ?> Function (
50
50
BuildContext context);
51
51
52
+ enum ToolbarAlignment { start, center, end }
53
+
52
54
// The default size of the icon of a button.
53
55
const double kDefaultIconSize = 18 ;
54
56
@@ -60,6 +62,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
60
62
required this .children,
61
63
this .toolBarHeight = 36 ,
62
64
this .toolBarSectionSpacing,
65
+ this .toolBarIconAlignment,
63
66
this .color,
64
67
this .filePickImpl,
65
68
this .multiRowsDisplay,
@@ -71,6 +74,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
71
74
required QuillController controller,
72
75
double toolbarIconSize = kDefaultIconSize,
73
76
double toolBarSectionSpacing = 4 ,
77
+ ToolbarAlignment toolBarIconAlignment = ToolbarAlignment .center,
74
78
bool showBoldButton = true ,
75
79
bool showItalicButton = true ,
76
80
bool showSmallButton = false ,
@@ -150,6 +154,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
150
154
key: key,
151
155
toolBarHeight: toolbarIconSize * 2 ,
152
156
toolBarSectionSpacing: toolBarSectionSpacing,
157
+ toolBarIconAlignment: toolBarIconAlignment,
153
158
multiRowsDisplay: multiRowsDisplay,
154
159
locale: locale,
155
160
children: [
@@ -413,6 +418,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
413
418
final List <Widget > children;
414
419
final double toolBarHeight;
415
420
final double ? toolBarSectionSpacing;
421
+ final ToolbarAlignment ? toolBarIconAlignment;
416
422
final bool ? multiRowsDisplay;
417
423
418
424
/// The color of the toolbar.
@@ -440,7 +446,13 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
440
446
initialLocale: locale,
441
447
child: multiRowsDisplay ?? true
442
448
? Wrap (
443
- alignment: WrapAlignment .center,
449
+ alignment:
450
+ (toolBarIconAlignment== ToolbarAlignment .start)
451
+ ? WrapAlignment .start
452
+ : (toolBarIconAlignment== ToolbarAlignment .center)
453
+ ? WrapAlignment .center
454
+ : (toolBarIconAlignment== ToolbarAlignment .end)
455
+ ? WrapAlignment .end : WrapAlignment .center,
444
456
runSpacing: 4 ,
445
457
spacing: toolBarSectionSpacing ?? 4 ,
446
458
children: children,
0 commit comments