RawView class

The lower level workhorse widget for View that bootstraps a render tree for a view.

Typically, the View widget is used instead of a RawView widget to create a view, since, in addition to creating a view, it also adds some useful widgets, such as a MediaQuery and FocusScope. The RawView widget is only used directly if it is not desirable to have these additional widgets around the resulting widget tree. The View widget uses the RawView widget internally to manage its FlutterView.

This widget can be used at the root of the widget tree outside of any other View or RawView widget, as a child to a ViewCollection, or in the ViewAnchor.view slot of a ViewAnchor widget. It is not required to be a direct child of those widgets; other non-RenderObjectWidgets may appear in between the two (such as an InheritedWidget).

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

Since the RawView widget bootstraps its own independent render tree, neither it nor any of its descendants will insert a RenderObject into an existing render tree. Therefore, the RawView widget can only be used in those parts of the widget tree where it is not required to participate in the construction of the surrounding render tree. In other words, the widget may only be used in a non-rendering zone of the widget tree (see WidgetsBinding for a definition of rendering and non-rendering zones).

To find the FlutterView associated with a BuildContext, use View.of or View.maybeOf, even if the view was created using RawView instead of View.

See also:

Inheritance

Constructors

RawView({Key? key, required FlutterView view, @Deprecated('Do not use. ' 'This parameter only exists to implement the deprecated RendererBinding.pipelineOwner property until it is removed. ' 'This feature was deprecated after v3.10.0-12.0.pre.') PipelineOwner? deprecatedDoNotUseWillBeRemovedWithoutNoticePipelineOwner, @Deprecated('Do not use. ' 'This parameter only exists to implement the deprecated RendererBinding.renderView property until it is removed. ' 'This feature was deprecated after v3.10.0-12.0.pre.') RenderView? deprecatedDoNotUseWillBeRemovedWithoutNoticeRenderView, required Widget child})
Creates a RawView widget.

Properties

child Widget
The widget below this widget in the tree, which will be drawn into the view.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
view FlutterView
The FlutterView into which child is drawn.
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