fluttercommunity / fluttercommunity/chewie
Layout when fullscreen enter and exit
- Dominant language
- Dart
- Stars
- 2.1k
- Forks
- 1.1k
- Avg merge
- 6d 8h
- Merged PRs (30d)
- 6
Description
When i toggle the video player into fullscreen model, the main page with embedded video player will be updated in landscape model, however it is designed for portrait model. It is not what i want.
The code of chewie player is as follow:
Future _pushFullScreenWidget(BuildContext context) async {
final isAndroid = Theme.of(context).platform == TargetPlatform.android;
final TransitionRoute route = PageRouteBuilder(
settings: RouteSettings(isInitialRoute: false),
pageBuilder: _fullScreenRoutePageBuilder,
);
SystemChrome.setEnabledSystemUIOverlays([]);
if (isAndroid) {
SystemChrome.setPreferredOrientations([
DeviceOrientation.landscapeLeft,
DeviceOrientation.landscapeRight,
]);
}
if (!widget.controller.allowedScreenSleep) {
Screen.keepOn(true);
}
await Navigator.of(context).push(route);
_isFullScreen = false;
widget.controller.exitFullScreen();
bool isKeptOn = await Screen.isKeptOn;
if (isKeptOn) {
Screen.keepOn(false);
}
SystemChrome.setEnabledSystemUIOverlays(
widget.controller.systemOverlaysAfterFullScreen);
SystemChrome.setPreferredOrientations(
widget.controller.deviceOrientationsAfterFullScreen);
}
}
I think it is more reasonable with next code order. If enter fullscreen, call push route first, then change orientation; if exit fullscreen, change orientation then pop and show main page, what do you think?
My english is not well, excuse me!
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at _pushFullScreenWidget and reproduce entering and exiting fullscreen on Android with the embedded video player in portrait mode. Check the order of route navigation and orientation changes, then verify that fullscreen uses landscape while the main page returns to its portrait orientation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart, flutter
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100