Skip to content

Commit

Permalink
Merge pull request #930 from KonstantenKomkov/bug_fix/issue_920
Browse files Browse the repository at this point in the history
Fix back button in YoutubePlayerScaffold after migration on PopScope.
  • Loading branch information
sarbagyastha authored Apr 12, 2024
2 parents b72befd + 97ddf95 commit 72a0981
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,12 @@ class _FullScreen extends StatefulWidget {

class _FullScreenState extends State<_FullScreen> with WidgetsBindingObserver {
Orientation? _previousOrientation;
bool canPop = false;

@override
void initState() {
super.initState();

canPop = Navigator.of(context).canPop();
if (widget.auto) WidgetsBinding.instance.addObserver(this);
SystemChrome.setPreferredOrientations(_deviceOrientations);
SystemChrome.setEnabledSystemUIMode(_uiMode);
Expand Down Expand Up @@ -201,7 +202,7 @@ class _FullScreenState extends State<_FullScreen> with WidgetsBindingObserver {
@override
Widget build(BuildContext context) {
return PopScope(
canPop: false,
canPop: canPop,
onPopInvoked: _handleFullScreenBackAction,
child: widget.child,
);
Expand Down

0 comments on commit 72a0981

Please sign in to comment.