NativeViewController class
NativeViewController creates a new controller to control an instance of NativeView.
final controller = NativeViewController(
handle: FindWindow(
nullptr,
'VLC Media Player'.toNativeUtf16(),
),
);
Pass the HWND of the window as handle.
In above example, we are using FindWindow from package:win32 to discover handle of the VLC Media Player's window.
Other Notes
When NativeView is no longer in use always make sure to dispose it using dispose.
controller.dispose();
The NativeView can be explicitly re-drawn using refresh.
controller.refresh();
Constructors
- NativeViewController({required int handle, HitTestBehavior hitTestBehavior = HitTestBehavior.opaque})
Properties
- entered ↔ bool
-
getter/setter pair
- handle → int
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hitTestBehavior ↔ HitTestBehavior
-
getter/setter pair
-
painterKey
→ GlobalKey<
State< StatefulWidget> > -
final
-
rendererKey
→ GlobalKey<
State< StatefulWidget> > -
final
-
resizeNativeViewStreamController
→ StreamController<
void> -
StreamController to avoid race & send Rects synchronously.
final
-
resizeNativeViewStreamSubscription
↔ StreamSubscription<
void> -
latefinal
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
createNativeView(
) → void - Creates a new NativeView.
-
dispose(
) → Future< void> - Disposes the NativeViewController instance & releases the resources.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
refresh(
{bool force = true}) → void - Causes NativeView associated with this NativeViewController to redraw & update its positioning.
-
setHitTestBehavior(
HitTestBehavior value) → void - Creates a new NativeView.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited