WidgetContext class

Immutable model representing contextual environment metadata associated with an inspected widget.

Annotations

Constructors

WidgetContext({String? route, String? semanticsLabel, String? semanticsHint, String? packageSource, int depth = 0, bool isFixed = false, double? scrollOffset, String? scrollAxis, Map<String, dynamic>? viewportBounds})
const
WidgetContext.empty()
Constructs an empty context fallback.
const
WidgetContext.fromJson(Map<String, dynamic> json)
Factory creating WidgetContext from a JSON map.
factory

Properties

depth → int
Depth of the widget within the active element hierarchy.
final
hashCode → int
The hash code for this object.
no setteroverride
isFixed → bool
True if element has fixed/sticky positioning (e.g. AppBar, bottom bar) and stays fixed on screen.
final
packageSource → String?
Package or library source origin, if detectable.
final
route → String?
The active navigation route name, if available.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scrollAxis → String?
Scroll axis direction of the enclosing scrollable.
final
scrollOffset → double?
Scroll offset of the enclosing scrollable at the time of inspection.
final
semanticsHint → String?
The accessibility semantics hint, if defined.
final
semanticsLabel → String?
The accessibility semantics label, if defined.
final
viewportBounds → Map<String, dynamic>?
Global rectangular bounds of the enclosing scrollable's viewport.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Converts this context model into a serializable JSON map.
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
override