@@ -49,8 +49,6 @@ 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
-
54
52
// The default size of the icon of a button.
55
53
const double kDefaultIconSize = 18 ;
56
54
@@ -60,21 +58,21 @@ const double kIconButtonFactor = 1.77;
60
58
class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
61
59
const QuillToolbar ({
62
60
required this .children,
63
- this .toolBarHeight = 36 ,
64
- this .toolBarSectionSpacing,
65
- this .toolBarIconAlignment,
61
+ this .toolbarHeight = 36 ,
62
+ this .toolbarIconAlignment = WrapAlignment .center,
63
+ this .toolbarSectionSpacing = 4 ,
64
+ this .multiRowsDisplay = true ,
66
65
this .color,
67
66
this .filePickImpl,
68
- this .multiRowsDisplay,
69
67
this .locale,
70
68
Key ? key,
71
69
}) : super (key: key);
72
70
73
71
factory QuillToolbar .basic ({
74
72
required QuillController controller,
75
73
double toolbarIconSize = kDefaultIconSize,
76
- double toolBarSectionSpacing = 4 ,
77
- ToolbarAlignment toolBarIconAlignment = ToolbarAlignment .center,
74
+ double toolbarSectionSpacing = 4 ,
75
+ WrapAlignment toolbarIconAlignment = WrapAlignment .center,
78
76
bool showBoldButton = true ,
79
77
bool showItalicButton = true ,
80
78
bool showSmallButton = false ,
@@ -152,9 +150,9 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
152
150
153
151
return QuillToolbar (
154
152
key: key,
155
- toolBarHeight : toolbarIconSize * 2 ,
156
- toolBarSectionSpacing : toolBarSectionSpacing ,
157
- toolBarIconAlignment : toolBarIconAlignment ,
153
+ toolbarHeight : toolbarIconSize * 2 ,
154
+ toolbarSectionSpacing : toolbarSectionSpacing ,
155
+ toolbarIconAlignment : toolbarIconAlignment ,
158
156
multiRowsDisplay: multiRowsDisplay,
159
157
locale: locale,
160
158
children: [
@@ -416,10 +414,10 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
416
414
}
417
415
418
416
final List <Widget > children;
419
- final double toolBarHeight ;
420
- final double ? toolBarSectionSpacing ;
421
- final ToolbarAlignment ? toolBarIconAlignment ;
422
- final bool ? multiRowsDisplay;
417
+ final double toolbarHeight ;
418
+ final double toolbarSectionSpacing ;
419
+ final WrapAlignment toolbarIconAlignment ;
420
+ final bool multiRowsDisplay;
423
421
424
422
/// The color of the toolbar.
425
423
///
@@ -438,23 +436,17 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
438
436
final Locale ? locale;
439
437
440
438
@override
441
- Size get preferredSize => Size .fromHeight (toolBarHeight );
439
+ Size get preferredSize => Size .fromHeight (toolbarHeight );
442
440
443
441
@override
444
442
Widget build (BuildContext context) {
445
443
return I18n (
446
444
initialLocale: locale,
447
- child: multiRowsDisplay ?? true
445
+ child: multiRowsDisplay
448
446
? Wrap (
449
- alignment: (toolBarIconAlignment == ToolbarAlignment .start)
450
- ? WrapAlignment .start
451
- : (toolBarIconAlignment == ToolbarAlignment .center)
452
- ? WrapAlignment .center
453
- : (toolBarIconAlignment == ToolbarAlignment .end)
454
- ? WrapAlignment .end
455
- : WrapAlignment .center,
447
+ alignment: toolbarIconAlignment,
456
448
runSpacing: 4 ,
457
- spacing: toolBarSectionSpacing ?? 4 ,
449
+ spacing: toolbarSectionSpacing ,
458
450
children: children,
459
451
)
460
452
: Container (
0 commit comments