HtmlToolbarOptions class
Options that modify the toolbar and its behavior
Constructors
-
HtmlToolbarOptions({List<
CustomButtonGroup> customButtonGroups = const [], List<Toolbar> defaultToolbarButtons = const [VoiceToTextButtons(), OtherButtons(copy: false, paste: false), FontButtons(), ColorButtons(), ParagraphButtons(textDirection: false, lineHeight: false, caseConverter: false), ListButtons(listStyles: false), InsertButtons(), OtherButtons(undo: false, redo: false)], bool initiallyExpanded = false, FutureOr<bool> linkInsertInterceptor(String, String, bool)?, FutureOr<bool> onButtonPressed(ButtonType, bool?, Function?)?, FutureOr<bool> onDropdownChanged(DropdownType, dynamic, void (dynamic)?)?, ToolbarType toolbarType = ToolbarType.nativeScrollable, ToolbarPosition toolbarPosition = ToolbarPosition.aboveEditor, int dropdownElevation = 8, Widget? dropdownIcon, Color? dropdownIconColor, double dropdownIconSize = 24, double dropdownItemHeight = kMinInteractiveDimension, Color? dropdownFocusColor, Color? dropdownBackgroundColor, DropdownMenuDirection? dropdownMenuDirection, double? dropdownMenuMaxHeight, BoxDecoration? dropdownBoxDecoration, BoxDecoration? toolbarDecoration, Color? backgroundColor, Color? buttonColor, Color? buttonSelectedColor, Color? buttonFillColor, Color? buttonFocusColor, Color? buttonHighlightColor, Color? buttonHoverColor, Color? buttonSplashColor, Color? buttonBorderColor, Color? buttonSelectedBorderColor, BorderRadius? buttonBorderRadius, double? buttonBorderWidth, bool renderBorder = false, TextStyle? textStyle, Widget separatorWidget = const VerticalDivider(indent: 2, endIndent: 2, color: Colors.grey), bool renderSeparatorWidget = true, double toolbarItemHeight = 36, double gridViewHorizontalSpacing = 5, double gridViewVerticalSpacing = 5})
Properties
- backgroundColor ↔ Color?
-
getter/setter pair
-
final
-
final
-
final
-
Styling options that only apply to the buttons:
(See the ToggleButtons class for more information)
final
-
final
-
final
-
final
-
final
-
final
-
final
-
final
- collapseDelay → Duration
-
Delay before the toolbar becomes hidden.
final
-
customButtonGroups
↔ List<
CustomButtonGroup> -
Allows you to set the allowed extensions when a user inserts an audio file
getter/setter pair
-
defaultToolbarButtons
→ List<
Toolbar> -
Sets which options are visible in the toolbar for the editor.
final
- dropdownBackgroundColor → Color?
-
final
- dropdownBoxDecoration → BoxDecoration?
-
final
- dropdownElevation → int
-
Styling options that only apply to dropdowns:
(See the DropdownButton class for more information)
final
- dropdownFocusColor → Color?
-
final
- dropdownIcon → Widget?
-
final
- dropdownIconColor → Color?
-
final
- dropdownIconSize → double
-
final
- dropdownItemHeight → double
-
final
- dropdownMenuDirection → DropdownMenuDirection?
-
Set the menu opening direction for the dropdown. Only useful when using
ToolbarPosition.custom since the toolbar otherwise automatically
determines the correct direction.
final
- dropdownMenuMaxHeight → double?
-
final
- fixedToolbar ↔ bool
-
If
true
, the toolbar will always be visible when the toolbar is set to above or below editor. Iffalse
it will collapse on blur.getter/setter pair - gridViewHorizontalSpacing → double
-
Sets the horizontal spacing between items when using ToolbarType.nativeGrid
final
- gridViewVerticalSpacing → double
-
Sets the vertical spacing between rows when using ToolbarType.nativeGrid
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- initiallyExpanded ↔ bool
-
Allows you to set the allowed extensions when a user inserts an image
getter/setter pair
-
linkInsertInterceptor
→ FutureOr<
bool> Function(String, String, bool)? -
Allows you to intercept any links being inserted into the editor. The
function passes the display text, the URL itself, and whether the
URL should open a new tab.
final
-
onButtonPressed
→ FutureOr<
bool> Function(ButtonType, bool?, Function?)? -
Allows you to intercept any image/video/audio inserted as a link into the editor.
The function passes the URL of the media inserted.
final
-
onDropdownChanged
→ FutureOr<
bool> Function(DropdownType, dynamic, void (dynamic)?)? -
Allows you to intercept any dropdown changes. The function passes the
DropdownType enum, which tells you which dropdown was changed,
the changed value to indicate what the dropdown was changed to, and the
function to update the changed value (in case you decide to handle the
dropdown change yourself). The function is null in some cases because
the dropdown does not update its value.
final
- renderBorder → bool
-
Allows you to set the allowed extensions when a user inserts a video.
final
- renderSeparatorWidget → bool
-
Determines whether the separator widget is rendered
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- separatorWidget → Widget
-
Sets the separator widget between toolbar sections. This widget is only
used in ToolbarType.nativeScrollable.
final
- textStyle → TextStyle?
-
Sets the text style for all toolbar widgets
final
- toolbarDecoration ↔ BoxDecoration?
-
Defines decoration of toolbar container
getter/setter pair
- toolbarItemHeight → double
-
Sets the height of the toolbar items
final
- toolbarPosition ↔ ToolbarPosition
-
Controls where the toolbar is positioned. See ToolbarPosition for more details.
getter/setter pair
- toolbarType ↔ ToolbarType
-
Called when a link is inserted for a file using the "other file" button.
getter/setter pair
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited