View class

Injects a FlutterView into the tree and makes it available to descendants within the same LookupBoundary via View.of and View.maybeOf.

The provided child is wrapped in a MediaQuery constructed from the given view.

In a future version of Flutter, the functionality of this widget will be extended to actually bootstrap the render tree that is going to be rendered into the provided view. This will enable rendering content into multiple FlutterViews from a single widget tree.

Each FlutterView can be associated with at most one View widget in the widget tree. Two or more View widgets configured with the same FlutterView must never exist within the same widget tree at the same time. Internally, this limitation is enforced by a GlobalObjectKey that derives its identity from the view provided to this widget.

Inheritance

Constructors

View({required FlutterView view, required Widget child})
Injects the provided view into the widget tree.

Properties

child Widget
This widget can only have one child. To lay out multiple children, let this widget's child be a widget such as Row, Column, or Stack, which have a children property, and then provide the children to that widget.
final
hashCode int
The hash code for this object.
read-onlyinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
view FlutterView
The FlutterView to be injected into the tree.
final

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

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

Static Methods

maybeOf(BuildContext context) FlutterView?
Returns the FlutterView that the provided context will render into.
of(BuildContext context) FlutterView
Returns the FlutterView that the provided context will render into.