Add a new parameter toolBarSectionSpacing to control the toolbar icon Wrap spacing (#461)

pull/463/head
mark8044 3 years ago committed by GitHub
parent 7e958b613a
commit 278980c677
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      lib/src/widgets/toolbar.dart

@ -59,6 +59,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
const QuillToolbar({ const QuillToolbar({
required this.children, required this.children,
this.toolBarHeight = 36, this.toolBarHeight = 36,
this.toolBarSectionSpacing,
this.color, this.color,
this.filePickImpl, this.filePickImpl,
this.multiRowsDisplay, this.multiRowsDisplay,
@ -69,6 +70,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
factory QuillToolbar.basic({ factory QuillToolbar.basic({
required QuillController controller, required QuillController controller,
double toolbarIconSize = kDefaultIconSize, double toolbarIconSize = kDefaultIconSize,
double toolBarSectionSpacing = 4,
bool showBoldButton = true, bool showBoldButton = true,
bool showItalicButton = true, bool showItalicButton = true,
bool showSmallButton = false, bool showSmallButton = false,
@ -147,6 +149,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
return QuillToolbar( return QuillToolbar(
key: key, key: key,
toolBarHeight: toolbarIconSize * 2, toolBarHeight: toolbarIconSize * 2,
toolBarSectionSpacing: toolBarSectionSpacing,
multiRowsDisplay: multiRowsDisplay, multiRowsDisplay: multiRowsDisplay,
locale: locale, locale: locale,
children: [ children: [
@ -409,6 +412,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
final List<Widget> children; final List<Widget> children;
final double toolBarHeight; final double toolBarHeight;
final double? toolBarSectionSpacing;
final bool? multiRowsDisplay; final bool? multiRowsDisplay;
/// The color of the toolbar. /// The color of the toolbar.
@ -438,7 +442,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
? Wrap( ? Wrap(
alignment: WrapAlignment.center, alignment: WrapAlignment.center,
runSpacing: 4, runSpacing: 4,
spacing: 4, spacing: toolBarSectionSpacing ?? 4,
children: children, children: children,
) )
: Container( : Container(

Loading…
Cancel
Save