diff --git a/lib/src/widgets/toolbar.dart b/lib/src/widgets/toolbar.dart index 1d7368f4e..305b5a472 100644 --- a/lib/src/widgets/toolbar.dart +++ b/lib/src/widgets/toolbar.dart @@ -66,6 +66,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget { this.sectionDividerColor, this.sectionDividerSpace, this.linkDialogAction, + this.decoration, Key? key, }) : super(key: key); @@ -110,6 +111,9 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget { bool showSuperscript = true, List customButtons = const [], + /// The decoration to use for the toolbar. + Decoration? decoration, + ///Map of font sizes in string Map? fontSizeValues, @@ -248,6 +252,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget { key: key, axis: axis, color: color, + decoration: decoration, toolbarSize: toolbarIconSize * 2, toolbarSectionSpacing: toolbarSectionSpacing, toolbarIconAlignment: toolbarIconAlignment, @@ -628,6 +633,9 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget { /// The space occupied by toolbar section divider. final double? sectionDividerSpace; + /// The decoration to use for the toolbar. + final Decoration? decoration; + @override Size get preferredSize => axis == Axis.horizontal ? Size.fromHeight(toolbarSize) @@ -647,11 +655,14 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget { children: children, ) : Container( + decoration: decoration ?? + BoxDecoration( + color: color ?? Theme.of(context).canvasColor, + ), constraints: BoxConstraints.tightFor( height: axis == Axis.horizontal ? toolbarSize : null, width: axis == Axis.vertical ? toolbarSize : null, ), - color: color ?? Theme.of(context).canvasColor, child: ArrowIndicatedButtonList( axis: axis, buttons: children,