Skip to content

feat: show click (pointer) cursor on hover over Material controls and progress bar#950

Open
Ortes wants to merge 1 commit into
fluttercommunity:masterfrom
Ortes:feat/click-cursor-controls
Open

feat: show click (pointer) cursor on hover over Material controls and progress bar#950
Ortes wants to merge 1 commit into
fluttercommunity:masterfrom
Ortes:feat/click-cursor-controls

Conversation

@Ortes
Copy link
Copy Markdown
Contributor

@Ortes Ortes commented May 31, 2026

Description

On web and desktop, hovering the mouse over the player controls keeps the default arrow cursor — there's no affordance that the buttons and the seek bar are clickable.

The affected controls (play/pause, mute, subtitle toggle, fullscreen, and the draggable progress bar) are built with GestureDetector, which — unlike IconButton — does not set a hover cursor. The options/subtitles IconButtons already show a pointer, so the bar is inconsistent.

This PR wraps the clickable child of each of those GestureDetectors in a MouseRegion(cursor: SystemMouseCursors.click) so the cursor turns into a pointer on hover, matching the IconButton-based controls.

What changed

  • MaterialControls — mute, fullscreen, subtitle toggle
  • MaterialDesktopControls — play/pause, mute, fullscreen
  • VideoProgressBar (shared) — the draggable progress/seek bar only; the non-draggable variant is left untouched

CupertinoControls is intentionally left out: it is touch-first (iOS) and its root already wraps everything in a MouseRegion. Happy to extend it in a follow-up if maintainers prefer full coverage.

Behavior

  • No functional or layout change — MouseRegion only affects the hover cursor.
  • The pointer region matches the existing tap region exactly (the MouseRegion wraps the same child the GestureDetector already used).

Testing

  • flutter analyze — no issues.
  • Built and ran the example/ app on web; controls behave identically, with the pointer cursor now appearing on hover over the buttons and the seek bar.

🤖 Generated with Claude Code

On web and desktop, the play/pause, mute, subtitles, fullscreen buttons
and the seek/progress bar were built with `GestureDetector`, which does
not change the mouse cursor on hover. As a result the pointer stayed the
default arrow, giving no affordance that the controls are clickable.

Wrap the clickable child of each of these `GestureDetector`s in a
`MouseRegion(cursor: SystemMouseCursors.click)` so the cursor turns into
a pointer on hover, matching the existing `IconButton`-based controls
(options/subtitles) which already do this. The non-draggable progress
bar is left untouched.

Covers `MaterialControls`, `MaterialDesktopControls` and the shared
`VideoProgressBar`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 31, 2026

Codecov Report

❌ Patch coverage is 86.36364% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 44.00%. Comparing base (69a8fc7) to head (20ff4cc).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
lib/src/material/material_controls.dart 72.72% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #950      +/-   ##
==========================================
+ Coverage   43.82%   44.00%   +0.18%     
==========================================
  Files          21       21              
  Lines        1602     1609       +7     
==========================================
+ Hits          702      708       +6     
- Misses        900      901       +1     

☔ View full report in Codecov by Sentry.
📢 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.

@Ortes Ortes marked this pull request as ready for review May 31, 2026 21:02
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