MockBuildContext class
- Implemented types
- Available extensions
Constructors
Properties
- debugDoingBuild → bool
-
Whether the widget is currently updating the widget or render tree.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- mounted → bool
-
Whether the Widget this context is associated with is currently
mounted in the widget tree.
no setterinherited
- owner → BuildOwner?
-
The BuildOwner for this context. The BuildOwner is in charge of
managing the rendering pipeline for this context.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- size → Size?
-
The size of the RenderBox returned by findRenderObject.
no setterinherited
- widget → Widget
-
The current configuration of the Element that is this BuildContext.
no setterinherited
Methods
-
canPop(
) → bool -
Available on BuildContext, provided by the GoRouterHelper extension
Returnstrueif there is more than 1 page on the stack. -
dependOnInheritedElement(
InheritedElement ancestor, {Object? aspect}) → InheritedWidget -
Registers this build context with
ancestorsuch that whenancestor's widget changes this build context is rebuilt.inherited -
dependOnInheritedWidgetOfExactType<
T extends InheritedWidget> ({Object? aspect}) → T? -
Returns the nearest widget of the given type
Tand creates a dependency on it, or null if no appropriate widget is found.inherited -
describeElement(
String name, {DiagnosticsTreeStyle style = DiagnosticsTreeStyle.errorProperty}) → DiagnosticsNode -
Returns a description of the Element associated with the current build context.
inherited
-
describeMissingAncestor(
{required Type expectedAncestorType}) → List< DiagnosticsNode> -
Adds a description of a specific type of widget missing from the current
build context's ancestry tree.
inherited
-
describeOwnershipChain(
String name) → DiagnosticsNode -
Adds a description of the ownership chain from a specific Element
to the error report.
inherited
-
describeWidget(
String name, {DiagnosticsTreeStyle style = DiagnosticsTreeStyle.errorProperty}) → DiagnosticsNode -
Returns a description of the Widget associated with the current build context.
inherited
-
dispatchNotification(
Notification notification) → void -
Start bubbling this notification at the given build context.
inherited
-
findAncestorRenderObjectOfType<
T extends RenderObject> () → T? -
Returns the RenderObject object of the nearest ancestor RenderObjectWidget widget
that is an instance of the given type
T.inherited -
findAncestorStateOfType<
T extends State< (StatefulWidget> >) → T? -
Returns the State object of the nearest ancestor StatefulWidget widget
that is an instance of the given type
T.inherited -
findAncestorWidgetOfExactType<
T extends Widget> () → T? -
Returns the nearest ancestor widget of the given type
T, which must be the type of a concrete Widget subclass.inherited -
findRenderObject(
) → RenderObject? -
The current RenderObject for the widget. If the widget is a
RenderObjectWidget, this is the render object that the widget created
for itself. Otherwise, it is the render object of the first descendant
RenderObjectWidget.
inherited
-
findRootAncestorStateOfType<
T extends State< (StatefulWidget> >) → T? -
Returns the State object of the furthest ancestor StatefulWidget widget
that is an instance of the given type
T.inherited -
getElementForInheritedWidgetOfExactType<
T extends InheritedWidget> () → InheritedElement? -
Obtains the element corresponding to the nearest widget of the given type
T, which must be the type of a concrete InheritedWidget subclass.inherited -
getInheritedWidgetOfExactType<
T extends InheritedWidget> () → T? -
Returns the nearest widget of the given InheritedWidget subclass
Tor null if an appropriate ancestor is not found.inherited -
go(
String location, {Object? extra}) → void -
Available on BuildContext, provided by the GoRouterHelper extension
Navigate to a location. -
goNamed(
String name, {Map< String, String> pathParameters = const <String, String>{}, Map<String, dynamic> queryParameters = const <String, dynamic>{}, Object? extra, String? fragment}) → void -
Available on BuildContext, provided by the GoRouterHelper extension
Navigate to a named route. -
namedLocation(
String name, {Map< String, String> pathParameters = const <String, String>{}, Map<String, dynamic> queryParameters = const <String, dynamic>{}, String? fragment}) → String -
Available on BuildContext, provided by the GoRouterHelper extension
Get a location from route name and parameters. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pop<
T extends Object?> ([T? result]) → void -
Available on BuildContext, provided by the GoRouterHelper extension
Pop the top page off the Navigator's page stack by calling Navigator.pop. -
push<
T extends Object?> (String location, {Object? extra}) → Future< T?> -
Available on BuildContext, provided by the GoRouterHelper extension
Push a location onto the page stack. -
pushNamed<
T extends Object?> (String name, {Map< String, String> pathParameters = const <String, String>{}, Map<String, dynamic> queryParameters = const <String, dynamic>{}, Object? extra}) → Future<T?> -
Available on BuildContext, provided by the GoRouterHelper extension
Navigate to a named route onto the page stack. -
pushReplacement(
String location, {Object? extra}) → void -
Available on BuildContext, provided by the GoRouterHelper extension
Replaces the top-most page of the page stack with the given URL location w/ optional query parameters, e.g./family/f2/person/p1?color=blue. -
pushReplacementNamed(
String name, {Map< String, String> pathParameters = const <String, String>{}, Map<String, dynamic> queryParameters = const <String, dynamic>{}, Object? extra}) → void -
Available on BuildContext, provided by the GoRouterHelper extension
Replaces the top-most page of the page stack with the named route w/ optional parameters, e.g.name='person', pathParameters={'fid': 'f2', 'pid': 'p1'}. -
replace(
String location, {Object? extra}) → void -
Available on BuildContext, provided by the GoRouterHelper extension
Replaces the top-most page of the page stack with the given one but treats it as the same page. -
replaceNamed(
String name, {Map< String, String> pathParameters = const <String, String>{}, Map<String, dynamic> queryParameters = const <String, dynamic>{}, Object? extra}) → void -
Available on BuildContext, provided by the GoRouterHelper extension
Replaces the top-most page with the named route and optional parameters, preserving the page key. -
toString(
) → String -
A string representation of this object.
inherited
-
visitAncestorElements(
ConditionalElementVisitor visitor) → void -
Walks the ancestor chain, starting with the parent of this build context's
widget, invoking the argument for each ancestor.
inherited
-
visitChildElements(
ElementVisitor visitor) → void -
Walks the children of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited