Skip to content

feat: toggle fullscreen with the F key on desktop - #955

Open
Ortes wants to merge 4 commits into
fluttercommunity:masterfrom
Ortes:feat/keyboard-fullscreen-toggle
Open

feat: toggle fullscreen with the F key on desktop#955
Ortes wants to merge 4 commits into
fluttercommunity:masterfrom
Ortes:feat/keyboard-fullscreen-toggle

Conversation

@Ortes

@Ortes Ortes commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

What

Adds an F keyboard shortcut on the desktop controls (MaterialDesktopControls) that toggles fullscreen — enters if windowed, exits if fullscreen. This complements the existing Esc shortcut (which only exits) and matches the convention of most desktop video players (YouTube, VLC, mpv…).

How

  • One extra branch in _MaterialDesktopControlsState._handleKeyPress for LogicalKeyboardKey.keyF, calling the existing _onExpandCollapse() (which already drives ChewieController.toggleFullScreen()).
  • Gated by chewieController.allowFullScreen, so it's a no-op when fullscreen is disabled.
  • Keyboard shortcuts are desktop-only by construction (AdaptiveControls routes desktop/web platforms to MaterialDesktopControls), consistent with the existing space/arrow/Esc shortcuts.

Tests

test/keyboard_fullscreen_toggle_test.dart covers toggling fullscreen on then off with repeated F presses, and that F is a no-op when allowFullScreen: false.

dart format, flutter analyze lib, and the full flutter test suite (with --test-randomize-ordering-seed random) are clean.

Ortes added 4 commits July 9, 2026 14:00
Add an F keyboard shortcut to the desktop controls that toggles
fullscreen (respecting allowFullScreen), complementing the existing
Esc-to-exit shortcut.
@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 50.49%. Comparing base (69a8fc7) to head (f6cceab).
⚠️ Report is 2 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant