ExtensionContext class
Provides information about the current element on the Html tree for
an Extension
to use.
Constructors
- ExtensionContext({required CurrentStep currentStep, required Node node, required HtmlParser parser, StyledElement? styledElement, BuildContext? buildContext, BuildChildrenCallback? buildChildrenCallback})
- Constructs a new ExtensionContext object with the given information.
Properties
-
attributes
→ LinkedHashMap<
String, String> -
Returns a linked hash map representing the attributes of the node, or an
empty map if it has no attributes.
no setter
- buildContext → BuildContext?
-
Guaranteed to be non-null only when
currentStep
isbuilding
, but it might not necessarily be the nearest BuildContext. Probably should use aBuilder
Widget if you need the most relevant BuildContext.final -
builtChildrenMap
→ Map<
StyledElement, InlineSpan> ? -
A map between the original StyledElement children of this node and the
fully built InlineSpan children of this node.
no setter
-
classes
→ Set<
String> -
Returns a set of classes on this Element, or an empty set if none are
present or this Node is not an html Element.
no setter
- currentStep → CurrentStep
-
Allows matchers to get a sense for what step the HtmlParser is pinging
them for. Only non-null in calls to
matches
.final - element → Element?
-
Returns the reference to the Html element if this Html node represents
and element. Otherwise returns null.
no setter
-
elementChildren
→ List<
Element> -
Returns the list of child Elements on this html Node, or an empty list if
there are no children.
no setter
- elementName → String
-
Returns the name of the Html element, or an empty string if the node is
a text content node, comment node, or any other node without a name.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String
-
Returns the id of the element, or an empty string if it is not present or
this Node is not an html Element.
no setter
-
inlineSpanChildren
→ List<
InlineSpan> ? -
The InlineSpan version of this node's children. Constructed lazily.
Guaranteed to be non-null only when
currentStep
isbuilding
.no setter - innerHtml → String
-
Returns the HTML within this element, or an empty string if there is none.
no setter
- node → Node
-
The HTML node being represented as a Flutter widget.
final
- parser → HtmlParser
-
A reference to the HtmlParser instance. Useful for calling callbacks
on the Html widget like
onLinkTap
.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- style → Style?
-
A reference to the Style on the StyledElement representation of this
node. Guaranteed to be non-null only after the preparing step.
no setter
- styledElement → StyledElement?
-
A reference to the StyledElement representation of this node.
Guaranteed to be non-null only after the preparing step
final
-
styledElementChildren
→ List<
StyledElement> -
The StyledElement version of this node's children. Guaranteed to be
non-null only after the preparing step.
no setter
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