SelectableMath class
Selectable math widget.
On top of non-selectable Math, it adds selection functionality. Users can select by long press gesture, drag gesture, moving selection handles or pointer selection. The selected region can be encoded into TeX and copied to clipboard.
See SelectableText as this widget aims to fully imitate its behavior.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- SelectableMath
Constructors
- SelectableMath({Key? key, SyntaxTree? ast, bool autofocus = false, Color? cursorColor, Radius? cursorRadius, double cursorWidth = 2.0, double? cursorHeight, DragStartBehavior dragStartBehavior = DragStartBehavior.start, bool enableInteractiveSelection = true, FocusNode? focusNode, MathStyle mathStyle = MathStyle.display, double? logicalPpi, OnErrorFallback onErrorFallback = defaultOnErrorFallback, MathOptions? options, ParseException? parseException, bool showCursor = false, double? textScaleFactor, TextSelectionControls? textSelectionControls, TextStyle? textStyle, ToolbarOptions? toolbarOptions})
-
SelectableMath default constructor.
const
- SelectableMath.tex(String expression, {Key? key, TexParserSettings settings = const TexParserSettings(), MathOptions? options, OnErrorFallback onErrorFallback = defaultOnErrorFallback, bool autofocus = false, Color? cursorColor, Radius? cursorRadius, double cursorWidth = 2.0, double? cursorHeight, DragStartBehavior dragStartBehavior = DragStartBehavior.start, bool enableInteractiveSelection = true, FocusNode? focusNode, MathStyle mathStyle = MathStyle.display, double? logicalPpi, bool showCursor = false, double? textScaleFactor, TextSelectionControls? textSelectionControls, TextStyle? textStyle, ToolbarOptions? toolbarOptions})
-
SelectableMath builder using a TeX string
factory
Properties
- ast → SyntaxTree?
-
The equation to display.
final
- autofocus → bool
-
Whether this text field should focus itself if nothing else is already
focused.
final
- cursorColor → Color?
-
The color to use when painting the cursor.
final
- cursorHeight → double?
-
How tall the cursor will be.
final
- cursorRadius → Radius?
-
How rounded the corners of the cursor should be.
final
- cursorWidth → double
-
How thick the cursor will be.
final
- dragStartBehavior → DragStartBehavior
-
Determines the way that drag start behavior is handled.
final
- enableInteractiveSelection → bool
-
Whether to enable user interface affordances for changing the
text selection.
final
- focusNode → FocusNode?
-
Defines the focus for this widget.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- logicalPpi → double?
-
{@macro flutter_math_fork.math_options.logicalPpi}
final
- mathStyle → MathStyle
-
final
- onErrorFallback → OnErrorFallback
-
Fallback widget when there are uncaught errors during parsing or building.
final
- options → MathOptions?
-
Equation style.
final
- parseException → ParseException?
-
Errors generated during parsing.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showCursor → bool
-
Whether to show cursor.
final
- textScaleFactor → double?
-
Deprecated. Will be removed in a future version of Flutter. Use
textScaler
instead.final - textSelectionControls → TextSelectionControls?
-
Optional delegate for building the text selection handles and toolbar.
final
- textStyle → TextStyle?
-
The style for rendered math analogous to Text.style.
final
- toolbarOptions → ToolbarOptions
-
Configuration of toolbar options.
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of
DiagnosticsNode
objects describing this node's children.inherited -
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
defaultOnErrorFallback(
FlutterMathException error) → Widget - Default fallback function for Math, SelectableMath