FFplayViewController class
Controls the fullscreen state of an FFplayView.
Create one controller per view, pass it to FFplayView.controller, then call enterFullscreen / exitFullscreen from any gesture, keyboard shortcut, external button, or other interaction — completely decoupled from the video widget itself.
final _controller = FFplayViewController(
onEnterFullscreen: () => windowManager.setFullScreen(true),
onExitFullscreen: () => windowManager.setFullScreen(false),
);
// Anywhere in the widget tree:
ElevatedButton(
onPressed: () => _controller.enterFullscreen(context),
child: const Text('Go fullscreen'),
);
Extends ChangeNotifier — listen to react when isFullscreen changes (e.g. to swap fullscreen / exit-fullscreen icons):
ListenableBuilder(
listenable: _controller,
builder: (_, __) => Icon(
_controller.isFullscreen ? Icons.fullscreen_exit : Icons.fullscreen,
),
)
Always dispose the controller when the owning widget is disposed.
- Inheritance
-
- Object
- ChangeNotifier
- FFplayViewController
Constructors
-
FFplayViewController({Future<
void> onEnterFullscreen()?, Future<void> onExitFullscreen()?})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- isFullscreen → bool
-
Whether the attached FFplayView is currently in fullscreen mode.
no setter
-
onEnterFullscreen
→ Future<
void> Function()? -
Called just before the fullscreen route is pushed.
On desktop, pass
() => windowManager.setFullScreen(true).final -
onExitFullscreen
→ Future<
void> Function()? -
Called after the fullscreen route is popped.
On desktop, pass
() => windowManager.setFullScreen(false).final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
dispose(
) → void -
Discards any resources used by the object.
inherited
-
enterFullscreen(
BuildContext context) → Future< void> -
Enter fullscreen.
contextmust be a widget context within the app's Navigator subtree (i.e. inside aMaterialApp/ Navigator). -
exitFullscreen(
) → Future< void> - Exit fullscreen programmatically (e.g. from an external button or keyboard shortcut). No-op when not currently in fullscreen.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited