fleather library

Fleather widgets and document model.

To use, import 'package:fleather/fleather.dart';.

Classes

AlignmentAttributeBuilder
AutoExitBlockRule
Heuristic rule to exit current block when user inserts two consecutive newlines.
AutoFormat
An AutoFormat is responsible for looking backwards for a pattern and applying a formatting suggestion to a document.
AutoFormatResult
The result of a AutoFormat.apply that has detected a pattern
AutoFormats
Registry for AutoFormats.
BackgroundColorAttributeBuilder
Builder for background color value. Color is interpreted from the lower 32 bits of an int.
BlockAttributeBuilder
Builder for block attribute styles (number/bullet lists, code and quote).
BlockEmbed
An object which occupies an entire line in a document and cannot co-exist inline with regular text.
BlockNode
A block represents a group of adjacent LineNodes with the same block style.
CatchAllDeleteRule
Fallback rule for delete operations which simply deletes specified text range without any special handling.
CatchAllInsertRule
Fallback rule which simply inserts text as-is without any special handling.
ClipboardManager
An abstract class for getting and setting data to clipboard
ColorButton
Toolbar button which allows to apply background color style to a portion of text.
ColorParchmentAttributeBuilder
Builder for color-based style attributes.
ContainerNode<T extends Node>
Container node can accommodate other nodes.
CursorController
Controls cursor of an editable widget.
CursorStyle
Style properties of editing cursor.
DeleteRule
A heuristic rule for delete operations.
DirectionAttributeBuilder
EditorState
Base interface for the editor state which defines contract used by various mixins.
EmbeddableObject
An object which can be embedded into a Parchment document.
EmbedNode
An embed node inside of a line in a Parchment document.
EnsureEmbedLineRule
Prevents user from merging a line containing a block embed with other lines.
EnsureLastLineBreakDeleteRule
FleatherClipboardData
Encapsulates clipboard data
FleatherController
FleatherCustomClipboardManager
A ClipboardManager which delegates getting and setting data to user and can be used to have rich clipboard.
FleatherEditor
Widget for editing rich text documents.
FleatherField
FleatherTheme
Applies a Fleather editor theme to descendant widgets.
FleatherThemeData
FleatherToolbar
FleatherVerticalCaretMovementRun
FLIconButton
Default icon button used in Fleather editor toolbar.
ForceNewlineForInsertsAroundBlockEmbedRule
Forces text inserted on the same line with a block embed (before or after it) to be moved to a new line adjacent to the original line.
ForegroundColorAttributeBuilder
Builder for text color value. Color is interpreted from the lower 32 bits of an int.
FormatLinkAtCaretPositionRule
Allows updating link format with collapsed selection.
FormatRule
A heuristic rule for format (retain) operations.
HeadingAttributeBuilder
Builder for heading attribute styles.
HorizontalRuleThemeData
Theme data for horizontal rule.
IndentationButton
IndentAttributeBuilder
InlineCodeThemeData
Theme data for inline code.
InsertBlockEmbedsRule
Handles all format operations which manipulate block embeds.
InsertEmbedButton
InsertRule
A heuristic rule for insert operations.
LeafNode
A leaf node in Parchment document tree.
LineNode
A line of rich text in a Parchment document.
LinkAttributeBuilder
Builder for link attribute values.
LinkStyleButton
Toolbar button for formatting text as a link.
LookupResult
Result of a child lookup in a ContainerNode.
Node
An abstract node in a document tree.
ParchmentAttribute<T>
Style attribute applicable to a segment of a Parchment document.
ParchmentAttributeBuilder<T>
Builder for style attributes.
ParchmentAttributeKey<T>
Interface for objects which provide access to an attribute key.
ParchmentChange
Represents a change in a ParchmentDocument.
ParchmentDocument
A rich text document.
ParchmentHeuristics
Registry for insert, format and delete heuristic rules used by ParchmentDocument documents.
ParchmentStyle
Collection of style attributes.
PlainTextClipboardManager
A ClipboardManager which only handles reading and setting of FleatherClipboardData.plainText and used by default in editor.
PreserveBlockStyleOnInsertRule
Preserves block style when user inserts text containing newlines.
PreserveInlineStylesRule
Preserves inline styles when user inserts text inside formatted segment.
PreserveLineFormatOnNewLineRule
Preserves line format when insert occurred at the end of a line (right before a newline).
PreserveLineStyleOnMergeRule
Preserves line format when user deletes the line's newline character effectively merging it with the next line.
PreserveLineStyleOnSplitRule
Preserves line format when user splits the line into two.
RawEditor
RawEditorState
RenderAbstractEditor
Base interface for editable render objects.
RenderEditor
Displays a Fleather document as a vertical list of document segments (lines and blocks).
ResolveInlineFormatRule
Produces Delta with inline-level attributes applied too all characters except newlines.
ResolveLineFormatRule
Produces Delta with line-level attributes applied strictly to newline characters.
RootNode
Root node of document tree.
SelectHeadingButton
Toolbar button which allows to apply heading style to a line of text in Fleather editor.
SelectorScope
SelectorScopeState
SpanEmbed
An object which can be embedded on the same line (inline) with regular text.
TextBlockTheme
Style theme applied to a block of rich text, including single-line paragraphs.
TextLine
Line of text in Fleather editor.
TextNode
A span of formatted text within a line in a Parchment document.
ToggleStyleButton
Toolbar button which allows to toggle a style attribute on or off.
UndoRedoButton
VerticalSpacing
Vertical spacing around a block of text.

Enums

ChangeSource
Source of a ParchmentChange.
LinkMenuAction
List of possible actions returned from LinkActionPickerDelegate.
ParchmentAttributeScope
Scope of a style attribute, defines context in which an attribute can be applied.

Mixins

StyledNode
Mixin used by nodes that wish to implement StyledNode interface.

Constants

kToolbarHeight → const double
throttleDuration → const Duration

Functions

defaultContextMenuBuilder(BuildContext context, EditorState editorState) Widget
Default implementation of a widget builder function for context menu.
defaultFleatherEmbedBuilder(BuildContext context, EmbedNode node) Widget
Default implementation of a builder function for embeddable objects in Fleather.
defaultSpellCheckMenuBuilder(BuildContext context, EditorState editorState) Widget
defaultToggleStyleButtonBuilder(BuildContext context, ParchmentAttribute attribute, IconData icon, bool isToggled, VoidCallback? onPressed) Widget
Default builder for toggle style buttons.

Typedefs

ColorButtonBuilder = Widget Function(BuildContext, Color?)
Signature of callbacks the returns a Widget from a BuildContext and a Color (null color to use the default color of the text - copes with dark mode).
FleatherContextMenuBuilder = Widget Function(BuildContext context, EditorState editableTextState)
Widget builder function for context menu in FleatherEditor.
FleatherCustomClipboardGetData = Future<FleatherClipboardData?> Function()
Used by FleatherCustomClipboardManager to get clipboard data.
FleatherCustomClipboardSetData = Future<void> Function(FleatherClipboardData data)
Used by FleatherCustomClipboardManager to set clipboard data.
FleatherEmbedBuilder = Widget Function(BuildContext context, EmbedNode node)
Builder function for embeddable objects in FleatherEditor.
LinkActionPickerDelegate = Future<LinkMenuAction> Function(BuildContext context, String link)
PickColor = Future<Color?> Function(BuildContext, String)
Signature of callbacks that return a Color picked from a palette built in a BuildContext with a String specifying the label of the null selection option
TextSelectionChangedHandler = void Function(TextSelection selection, SelectionChangedCause cause)
Signature for the callback that reports when the user changes the selection (including the cursor location).
ToggleStyleButtonBuilder = Widget Function(BuildContext context, ParchmentAttribute attribute, IconData icon, bool isToggled, VoidCallback? onPressed)
Builder for toolbar buttons handling toggleable style attributes.