From 43d204356550865a572a4bc608b1db353fe6da6b Mon Sep 17 00:00:00 2001 From: Milind Goel <45682747+milindgoel15@users.noreply.github.com> Date: Thu, 19 Oct 2023 20:50:45 +0530 Subject: [PATCH] Changes to default editor and toolbar values (#1438) --- lib/src/widgets/toolbar.dart | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/src/widgets/toolbar.dart b/lib/src/widgets/toolbar.dart index 1d7368f4..305b5a47 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,