FullscreenHeroFlight class
What the Dart fullscreen route needs to grow the video out of the inline player and shrink it back into it: where the inline player is, and a still frame to fly between the two.
A frame flies instead of the video itself: a platform view cannot be resized smoothly every frame, and the fullscreen route's own view needs a moment to show its first frame. The live fullscreen video takes over once the route is fully open.
Constructors
-
FullscreenHeroFlight({required Uint8List? poster, required Rect startRect, required Rect? inlineRect(), required Future<
Uint8List?> capturePoster(), double? videoAspectRatio, double? currentAspectRatio()?, BorderRadius inlineBorderRadius = BorderRadius.zero, Future<int?> createLiveTexture()?, void disposeLiveTexture(int textureId)?, int? liveTextureId, VoidCallback? onReturn, VoidCallback? onLanding, VoidCallback? onDone, })
Properties
-
capturePoster
→ Future<
Uint8List?> Function() -
Captures the frame the player shows now.
final
-
createLiveTexture
→ Future<
int?> Function()? -
final
- currentAspectRatio → double? Function()?
-
The video's aspect ratio now, or null while there is no video frame
(a video that only loaded in fullscreen flies back as a video).
final
- dismissedBackdropOpacity ↔ double
-
The backdrop's opacity when the swipe dismissed it.
getter/setter pair
- dismissedCornerRadius ↔ double
-
The video's corner radius when the swipe dismissed it (the drag rounds
it), so the way back starts with those corners.
getter/setter pair
- dismissedFromRect ↔ Rect?
-
Where the page's content was when a swipe dismissed it, so the way back
starts there instead of jumping to full screen first.
getter/setter pair
- disposeLiveTexture → void Function(int textureId)?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- inlineBorderRadius → BorderRadius
-
The corners of the inline player's clip, which the frame takes on as it
lands inline and sheds (square) in fullscreen.
final
- inlineRect → Rect? Function()
-
The inline player's global rect now, or null when it is gone. Read when
fullscreen closes: a rotation in fullscreen moves the inline player.
final
- liveTextureId ↔ int?
-
A live engine texture of the player that flies on top of poster, so
the video keeps playing during the flight. One per leg: created right
before it (prepareReturn for the way back) and released when it ends,
so nothing copies frames while fullscreen is open. Null flies the frame.
getter/setter pair
- onDone → VoidCallback?
-
Called once the flight is over (the fullscreen route is gone, or
opened and closed without flying).
final
- onLanding → VoidCallback?
-
Called when the way back has nearly landed (the flight covers the
inline slot from then on, so the slot can show the video again without
it showing twice).
final
- onReturn → VoidCallback?
-
Called when the way back starts.
final
- poster ↔ Uint8List?
-
The frame that flies (JPEG). Refreshed by refreshPoster before the
way back, since the video kept playing in fullscreen. Painted under
liveTextureId, so it only shows until the live video has a frame.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
The player's active texture (Android texture mode): flown live as is,
with no texture of its own for the flight.
final
- startRect → Rect
-
The inline player's global rect when fullscreen opened.
final
- videoAspectRatio ↔ double?
-
Width / height of the video. Both players letterbox it (aspect fit),
so the frame flies between the video's own rects inside the inline box
and inside the screen, never a black box around it. Null flies the
boxes themselves. Updated from currentAspectRatio for the way back.
getter/setter pair
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
prepareReturn(
BuildContext context) → Future< void> - Readies the way back: the frame showing now and a live texture.
-
refreshPoster(
BuildContext context) → Future< void> - Replaces poster with the frame showing now, decoded and ready to paint. Gives up after a short wait: closing must not stall.
-
releaseLiveTexture(
) → void - Releases the current leg's live texture.
-
toString(
) → String -
A string representation of this object.
inherited
-
videoRectIn(
Rect box) → Rect -
The video's aspect-fit rect inside
box.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited