Locks the device orientation while a game is open, and restores it on
close. The game freezes to whatever orientation it opened in (portrait or
landscape); closing restores the system default (all orientations), so a
host with its own global lock should re-apply it after the game.
Port of the orientation freeze in iOS GamePresenter and Android
GamificationRenderer. Never throws.
Deprecated: games no longer lock orientation (Android fix: do not lock orientation while the game is open; iOS never locked). A rotation resizes the container and flows into the viewport push. Kept for existing tests.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
-
appliedForTesting
→ List<
DeviceOrientation> ? -
The orientations last applied, for tests.
no setter
-
sendForTesting
↔ Future<
void> Function(List<DeviceOrientation> orientations)? -
Test seam: replaces the
SystemChromecall. Null in production.getter/setter pair
Static Methods
-
freezeLandscape(
) → Future< void> - Freezes rotation to landscape while the game is open.
-
freezePortrait(
) → Future< void> - Freezes rotation to portrait while the game is open.
-
resetForTesting(
) → void - Test-only reset.
-
unfreeze(
) → Future< void> - Restores rotation after the game closes.