WidgetMatcherExtensions<W extends Widget> extension
Extension on WidgetMatcher
These matchers facilitate more specific assertions on widget properties, element properties, and render object properties.
- on
Methods
-
getElementProp<
T> (NamedElementProp< T> prop) → T - Retrieves a specific property from the matched widget's element.
-
getRenderObjectProp<
T, R extends RenderObject> (NamedRenderObjectProp< R, T> prop) → T - Retrieves a specific property from the matched widget's render object.
-
getWidgetProp<
T> (NamedWidgetProp< W, T> prop) → T - Retrieves a specific property from the matched widget.
-
hasElementProp<
T> ({required NamedElementProp< T?> prop, required MatchProp<T> match}) → WidgetMatcher<W> - Asserts that an element's property meets a specific condition.
-
hasProp<
T> ({Subject< T> elementSelector(Subject<Element> )?, Subject<T> widgetSelector(Subject<W> )?, required MatchProp<T> match}) → WidgetMatcher<W> -
Allows checking for properties of Element that are stored in child
Widgets or in the state.
Use selector to extract the actual value and validate it with
match
. -
hasRenderObjectProp<
T, R extends RenderObject> ({required NamedRenderObjectProp< R, T?> prop, required MatchProp<T> match}) → WidgetMatcher<W> - Asserts that a render object's property meets a specific condition.
-
hasWidgetProp<
T> ({required NamedWidgetProp< W, T?> prop, required MatchProp<T> match}) → WidgetMatcher<W> - Asserts that a widget's property meets a specific condition.