SmartEditorSettings class

Comprehensive settings for the editor's behavior, style, and events.

This class merges what was previously split across Editor, Scroll, Keyboard, Selection, Style, and Callbacks settings into a single unified configuration object.

Constructors

SmartEditorSettings({String? hint, String? initialText, bool? darkMode, bool disabled = false, bool readOnly = false, bool spellCheck = false, int? characterLimit, int? maxLines, bool processInputHtml = true, bool processOutputHtml = true, bool processNewLineAsBr = false, double defaultFontSize = 16.0, bool autoAdjustHeight = true, bool ensureVisible = false, ScrollPhysics? scrollPhysics, SmartInputType inputType = SmartInputType.text, bool adjustForKeyboard = true, Brightness? keyboardAppearance, TextInputAction? textInputAction, bool autofocus = false, Color? selectionColor, Color? cursorColor, double cursorWidth = 2.0, Radius? cursorRadius, double? cursorHeight, bool showCursor = true, Color? selectionHandleColor, bool enableInteractiveSelection = true, BoxDecoration? decoration, BoxDecoration? editorDecoration, EdgeInsets editorPadding = const EdgeInsets.all(12), Color? editorBackgroundColor, BorderRadius? borderRadius, void onChangeContent(String?)?, void onChangeSelection(Map<String, dynamic>)?, void onFocus()?, void onBlur()?, void onInit()?, void onEnter()?, void onKeyUp(String?)?, void onKeyDown(String?)?, void onPaste()?, String? onTagSerialize(SmartTagType type, String tag, Map<String, String> attributes, Map<String, String> styles, String content)?})
const

Properties

adjustForKeyboard bool
Shrinks the editor when the keyboard appears
final
autoAdjustHeight bool
Automatically adjusts editor height to fit content
final
autofocus bool
Whether to automatically focus the editor on load
final
borderRadius BorderRadius?
Default border radius if no decoration is provided
final
characterLimit int?
Maximum number of characters allowed
final
cursorColor Color?
Color of the blinking vertical cursor
final
cursorHeight double?
Height of the cursor. null uses default.
final
cursorRadius Radius?
Rounded corners for the cursor
final
cursorWidth double
Width of the cursor in logical pixels
final
darkMode bool?
Dark mode control (null = system theme)
final
decoration BoxDecoration?
Decoration around the entire editor container
final
defaultFontSize double
The default font size for the editor
final
disabled bool
Starts the editor in disabled (non-interactive) mode
final
editorBackgroundColor Color?
Background color of the editor area
final
editorDecoration BoxDecoration?
Decoration around just the text input area
final
editorPadding EdgeInsets
Padding inside the text input area
final
enableInteractiveSelection bool
Whether the user can interactively select text
final
ensureVisible bool
Scrolls the editor into view when it gains focus
final
hashCode int
The hash code for this object.
no setterinherited
hint String?
Placeholder text shown when the editor is empty
final
initialText String?
Initial HTML content to pre-fill the editor
final
inputType SmartInputType
The type of virtual keyboard to display
final
keyboardAppearance Brightness?
Keyboard brightness (iOS mostly)
final
maxLines int?
Maximum number of lines (blocks) before the editor starts scrolling
final
onBlur → void Function()?
Called when the editor loses focus
final
onChangeContent → void Function(String?)?
Called whenever the HTML content of the editor changes
final
onChangeSelection → void Function(Map<String, dynamic>)?
Called whenever the cursor position or selection changes
final
onEnter → void Function()?
Called when the Enter/Return key is pressed
final
onFocus → void Function()?
Called when the editor gains focus
final
onInit → void Function()?
Called when the editor is fully initialized
final
onKeyDown → void Function(String?)?
Called when a key is pressed down
final
onKeyUp → void Function(String?)?
Called when a key is released
final
onPaste → void Function()?
Called when text is pasted into the editor
final
onTagSerialize String? Function(SmartTagType type, String tag, Map<String, String> attributes, Map<String, String> styles, String content)?
Custom tag serialization callback. Allows users to intercept and modify any HTML tag before it's written.
final
processInputHtml bool
Whether to process input HTML (clean up quotes, newlines, etc.)
final
processNewLineAsBr bool
Whether to convert \n to <br> in input HTML
final
processOutputHtml bool
Whether to process output HTML (return "" for empty editor)
final
readOnly bool
Starts the editor in read-only mode (allows selection/copying)
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollPhysics ScrollPhysics?
Custom scroll physics for the editor's scroll view
final
selectionColor Color?
Background color of selected text
final
selectionHandleColor Color?
Color of the selection drag handles on mobile
final
showCursor bool
Whether to show the cursor
final
spellCheck bool
Enables browser/OS spell checking
final
textInputAction TextInputAction?
The action button on the keyboard (done, search, etc.)
final

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