blob: bf1c7f87c80bef4417bbce64b67ffc8efba58dc1 [file] [log] [blame] [view]
# FuchsiaViewController class
*[<Null safety>](https://dart.dev/null-safety)*
<p>A connection to a fuchsia view. It can be used to construct a <a href="../package-fuchsia_scenic_flutter_fuchsia_view/FuchsiaView-class.md">FuchsiaView</a>
widget that will display the view's contents on their own layer.</p>
**Implementers**
- [FuchsiaViewConnection](../package-fuchsia_scenic_flutter_fuchsia_view/FuchsiaViewConnection-class.md)
## Constructors
[FuchsiaViewController](../package-fuchsia_scenic_flutter_fuchsia_view/FuchsiaViewController/FuchsiaViewController.md) ({required int viewId, [FuchsiaViewConnectionCallback](../package-fuchsia_scenic_flutter_fuchsia_view/FuchsiaViewConnectionCallback.md)? onViewConnected, [FuchsiaViewConnectionCallback](../package-fuchsia_scenic_flutter_fuchsia_view/FuchsiaViewConnectionCallback.md)? onViewDisconnected, [FuchsiaViewConnectionStateCallback](../package-fuchsia_scenic_flutter_fuchsia_view/FuchsiaViewConnectionStateCallback.md)? onViewStateChanged, [FuchsiaPointerEventsCallback](../package-fuchsia_scenic_flutter_fuchsia_view/FuchsiaPointerEventsCallback.md)? onPointerEvent})
Constructor.
## Properties
##### [connected](../package-fuchsia_scenic_flutter_fuchsia_view/FuchsiaViewController/connected.md) &#8594; bool
Returns true when platform view is connected.
_<span class="feature read-only">read-only</span>_
##### [hashCode](../package-fuchsia_scenic_flutter_fuchsia_view/FuchsiaViewController/hashCode.md) &#8594; int
The hash code for this object.
_<span class="feature read-only">read-only</span><span class="feature inherited">inherited</span>_
##### [onPointerEvent](../package-fuchsia_scenic_flutter_fuchsia_view/FuchsiaViewController/onPointerEvent.md) &#8594; [FuchsiaPointerEventsCallback](../package-fuchsia_scenic_flutter_fuchsia_view/FuchsiaPointerEventsCallback.md)?
Callback when pointer events are dispatched on top of child view.
_<span class="feature final">final</span>_
##### [onViewConnected](../package-fuchsia_scenic_flutter_fuchsia_view/FuchsiaViewController/onViewConnected.md) &#8594; [FuchsiaViewConnectionCallback](../package-fuchsia_scenic_flutter_fuchsia_view/FuchsiaViewConnectionCallback.md)?
Callback when the connection to child's view is connected to view tree.
_<span class="feature final">final</span>_
##### [onViewDisconnected](../package-fuchsia_scenic_flutter_fuchsia_view/FuchsiaViewController/onViewDisconnected.md) &#8594; [FuchsiaViewConnectionCallback](../package-fuchsia_scenic_flutter_fuchsia_view/FuchsiaViewConnectionCallback.md)?
Callback when the child's view is disconnected from view tree.
_<span class="feature final">final</span>_
##### [onViewStateChanged](../package-fuchsia_scenic_flutter_fuchsia_view/FuchsiaViewController/onViewStateChanged.md) &#8594; [FuchsiaViewConnectionStateCallback](../package-fuchsia_scenic_flutter_fuchsia_view/FuchsiaViewConnectionStateCallback.md)?
Callback when the child view's state changes.
_<span class="feature final">final</span>_
##### [runtimeType](../package-fuchsia_scenic_flutter_fuchsia_view/FuchsiaViewController/runtimeType.md) &#8594; Type
A representation of the runtime type of the object.
_<span class="feature read-only">read-only</span><span class="feature inherited">inherited</span>_
##### [viewId](../package-fuchsia_scenic_flutter_fuchsia_view/FuchsiaViewController/viewId.md) &#8594; int
The raw value of the <code>ViewHolderToken</code> or <code>ViewportCreationToken</code> where
this view is attached.
_<span class="feature final">final</span>_
##### [viewport](../package-fuchsia_scenic_flutter_fuchsia_view/FuchsiaViewController/viewport.md) &#8594; dynamic
Returns the viewport rect of the child view in parent's coordinates.
_<span class="feature read-only">read-only</span>_
##### [whenConnected](../package-fuchsia_scenic_flutter_fuchsia_view/FuchsiaViewController/whenConnected.md) &#8594; Future
The future that completes when the platform view is connected.
_<span class="feature read-only">read-only</span>_
## Methods
##### [clearFocus](../package-fuchsia_scenic_flutter_fuchsia_view/FuchsiaViewController/clearFocus.md)() Future&lt;void>
##### [connect](../package-fuchsia_scenic_flutter_fuchsia_view/FuchsiaViewController/connect.md)({bool hitTestable = true, bool focusable = true, dynamic viewOcclusionHint = Rect.zero}) Future&lt;void>
Connects to the platform view given it's <a href="../package-fuchsia_scenic_flutter_fuchsia_view/FuchsiaViewController/viewId.md">viewId</a>.
##### [dispatchPointerEvent](../package-fuchsia_scenic_flutter_fuchsia_view/FuchsiaViewController/dispatchPointerEvent.md)(dynamic event) Future&lt;void>
Dispatch pointer events for the child view. This MUST NOT be called
directly.
##### [dispose](../package-fuchsia_scenic_flutter_fuchsia_view/FuchsiaViewController/dispose.md)() Future&lt;void>
Dispose relevant resources when the view is take <code>OffStage</code> by Flutter.
##### [noSuchMethod](../package-fuchsia_scenic_flutter_fuchsia_view/FuchsiaViewController/noSuchMethod.md)(Invocation invocation) dynamic
Invoked when a non-existent method or property is accessed.
_<span class="feature inherited">inherited</span>_
##### [requestFocus](../package-fuchsia_scenic_flutter_fuchsia_view/FuchsiaViewController/requestFocus.md)(int viewRef) Future&lt;void>
Requests that focus be transferred to the child view referred to by
viewRef. Note that this method should only be used with Scenics legacy
GFX API
##### [requestFocusById](../package-fuchsia_scenic_flutter_fuchsia_view/FuchsiaViewController/requestFocusById.md)(int viewId) Future&lt;void>
Requests that focus be transferred to the child view referred to by
viewId. Note that this method should only be used with the Flatland API
##### [toString](../package-fuchsia_scenic_flutter_fuchsia_view/FuchsiaViewController/toString.md)() String
A string representation of this object.
_<span class="feature inherited">inherited</span>_
##### [update](../package-fuchsia_scenic_flutter_fuchsia_view/FuchsiaViewController/update.md)({bool focusable = true, bool hitTestable = true, dynamic viewOcclusionHint = Rect.zero}) Future&lt;void>
Updates properties on the platform view given it's <a href="../package-fuchsia_scenic_flutter_fuchsia_view/FuchsiaViewController/viewId.md">viewId</a>.
## Operators
##### [operator ==](../package-fuchsia_scenic_flutter_fuchsia_view/FuchsiaViewController/operator_equals.md)(Object other) bool
The equality operator.
_<span class="feature inherited">inherited</span>_