StyledTextWidgetTag class Null safety

The class with which you can specify the widget to insert in place of the tag.

In the example below, an input field is inserted in place of the tag:

StyledText(
  text: 'Text with <input/> inside.',
  tags: {
    'input': StyledTextWidgetTag(
      TextField(
        decoration: InputDecoration(
          hintText: 'Input',
        ),
      ),
      size: Size.fromWidth(200),
      constraints: BoxConstraints.tight(Size(100, 50)),
    ),
  },
)
Inheritance

Constructors

StyledTextWidgetTag(Widget child, {Size? size, BoxConstraints? constraints, PlaceholderAlignment alignment = PlaceholderAlignment.middle, TextBaseline baseline = TextBaseline.alphabetic})

Properties

alignment PlaceholderAlignment
Aligning the widget relative to the text.
final, inherited
baseline TextBaseline?
The TextBaseline to align against when using ui.PlaceholderAlignment.baseline, ui.PlaceholderAlignment.aboveBaseline, and ui.PlaceholderAlignment.belowBaseline. [...]
final, inherited
builder StyledTextWidgetBuilderTagCallback
Widget builder to insert in place of the tag.
final, inherited
constraints BoxConstraints?
Additional constraints to apply to the widget.
final, inherited
hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
size Size?
The size of the available space for the widget, if not specified, the widget will take up all the available space.
final, inherited

Methods

createRecognizer(String? text, Map<String?, String?> attributes) GestureRecognizer?
inherited
createSpan({required BuildContext context, String? text, List<InlineSpan>? children, required Map<String?, String?> attributes, GestureRecognizer? recognizer}) InlineSpan
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
A string representation of this object. [...]
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited