feat: toggle fullscreen with the F key on desktop - #955
Open
Ortes wants to merge 4 commits into
Open
Conversation
Add an F keyboard shortcut to the desktop controls that toggles fullscreen (respecting allowFullScreen), complementing the existing Esc-to-exit shortcut.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #955 +/- ##
==========================================
+ Coverage 43.82% 50.49% +6.67%
==========================================
Files 21 21
Lines 1602 1606 +4
==========================================
+ Hits 702 811 +109
+ Misses 900 795 -105 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
What
Adds an
Fkeyboard shortcut on the desktop controls (MaterialDesktopControls) that toggles fullscreen — enters if windowed, exits if fullscreen. This complements the existingEscshortcut (which only exits) and matches the convention of most desktop video players (YouTube, VLC, mpv…).How
_MaterialDesktopControlsState._handleKeyPressforLogicalKeyboardKey.keyF, calling the existing_onExpandCollapse()(which already drivesChewieController.toggleFullScreen()).chewieController.allowFullScreen, so it's a no-op when fullscreen is disabled.AdaptiveControlsroutes desktop/web platforms toMaterialDesktopControls), consistent with the existing space/arrow/Esc shortcuts.Tests
test/keyboard_fullscreen_toggle_test.dartcovers toggling fullscreen on then off with repeatedFpresses, and thatFis a no-op whenallowFullScreen: false.dart format,flutter analyze lib, and the fullflutter testsuite (with--test-randomize-ordering-seed random) are clean.