Skip to content

Commit

Permalink
Changes to default editor and toolbar values (#1438)
Browse files Browse the repository at this point in the history
  • Loading branch information
milindgoel15 authored Oct 19, 2023
1 parent 988c41b commit 43d2043
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lib/src/widgets/toolbar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
this.sectionDividerColor,
this.sectionDividerSpace,
this.linkDialogAction,
this.decoration,
Key? key,
}) : super(key: key);

Expand Down Expand Up @@ -110,6 +111,9 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
bool showSuperscript = true,
List<QuillCustomButton> customButtons = const [],

/// The decoration to use for the toolbar.
Decoration? decoration,

///Map of font sizes in string
Map<String, String>? fontSizeValues,

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand All @@ -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,
Expand Down

0 comments on commit 43d2043

Please sign in to comment.