feat: native browser fullscreen on web#1
Closed
Ortes wants to merge 13 commits into
Closed
Conversation
…imer-mounted-check fix: add mounted check in _startHideTimer to prevent setState after dispose
…pgrade Flutter 3.41 Upgrade
…owngrade Flutter 3.38 downgrade.
When running as a Flutter Web app, the fullscreen button now triggers the browser's native Fullscreen API (document.documentElement.requestFullscreen) in addition to Chewie's internal route-based fullscreen. This gives users a true OS-level fullscreen instead of just expanding within the browser window. Pressing Escape to exit native fullscreen also collapses Chewie's fullscreen route, keeping both states in sync. Implemented via conditional import (dart.library.html): web_fullscreen.dart uses package:web + dart:js_interop; web_fullscreen_stub.dart provides no-ops for non-web platforms. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add ChewieController.useNativeFullScreenOnWeb (default true) so the native browser Fullscreen behavior is opt-out rather than an unconditional change. No effect on non-web platforms. Also adds a CHANGELOG entry. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Remove `// ignore: uri_does_not_exist`; chewie_player.dart now imports the plain `web_fullscreen.dart` abstraction, which conditionally exports the stub or the real implementation. - Use `dart.library.js_interop` instead of `dart.library.html` for the conditional export. - Move the dart:js_interop / package:web implementation into web_fullscreen_impl.dart. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ullscreen # Conflicts: # CHANGELOG.md # pubspec.yaml
Owner
Author
|
Closing: this fork self-PR is redundant with upstream PR fluttercommunity#946 which tracks the same feat/web-native-fullscreen work. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On Flutter Web, the fullscreen button now triggers the browser's native (OS-level) Fullscreen API (
document.documentElement.requestFullscreen()) in addition to Chewie's route-based fullscreen — instead of merely expanding the Flutter view inside the browser window.fullscreenchangelistener), keeping both states in sync.ChewieController.useNativeFullScreenOnWebflag, defaulttrue. No effect on non-web platforms.dart.library.html) so non-web builds use no-op stubs and never referencepackage:web.Implementation
lib/src/web_fullscreen.dart— web implementation usingpackage:web+dart:js_interoplib/src/web_fullscreen_stub.dart— no-op stubs for non-web platformslib/src/chewie_player.dart:useNativeFullScreenOnWebfield + constructor param +copyWithinitStateregisters afullscreenchangelistener (Escape → exit) when enabled_pushFullScreenWidgetcallsrequestBrowserFullscreen()before the firstawait(still inside the user-gesture handler, so the browser permits it)exitBrowserFullscreen()exits native fullscreenpubspec.yaml— addsweb: ^1.0.0🤖 Generated with Claude Code