Repository navigation
Unify snackbars behind a coalescing queue and a shared theme - #319
Merged
Merged
Conversation
A mid-fade seek now lands in the incoming track and ends the fade, retiring the outgoing source and publishing its completion so the Dart handoff bookkeeping stays exact-once. The Dart completion handler skips a stale TrackEnded when the engine is already on the expected track, preventing a skipped song.
Introduce a shared SnackBarTheme and a showFlickSnackBar helper so transient feedback is consistent and deduplicated by id. The player bar is a body overlay that Scaffold cannot account for, so reserve clearance via the snackbar inset padding.
Replace direct ScaffoldMessenger.showSnackBar calls with the showFlickSnackBar extension across screens and widgets for consistent snackbar behavior.
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
Replaces ad-hoc
ScaffoldMessenger.showSnackBarcalls with one app-widesnackbar surface: consistent styling, deduplication, queueing, and a
lifetime that respects the user's motion, accessibility, and app state.
Shared API and theme
lib/widgets/common/flick_snackbar.dart: an extension onScaffoldMessengerStatewithshowFlickSnackBar(SnackBar, {Object? id}),hideFlickSnackBar({Object? id}), andclearFlickSnackBars(). Each messenger gets its own queue via anExpando, so state does not leak between hosts or tests.SnackBarTheme(floating,surfaceLightsurface, glass border,radiusMd, zero elevation, body text style, accent action text, close icon,16/8/16/12inset) toAppTheme.darkTheme.ScaffoldMessenger.showSnackBarcall across 45 files (player sheets/controls/navigation, lyrics, playlists, favorites, settings, duplicate cleaner, logs, UAC2 prompts, ALAC conversion, and more). No direct calls remain inlib/.Queue, coalescing, and identity
id+ text + background while visible only refreshes the timer, and a rapid burst keeps only the latest routine message instead of stacking.idmay update itself without replaying a stale backlog.idenables targeted dismissal.playback-desyncandmetadata-warmupinlib/app/app.dartare now hidden by id, so clearing one status no longer wipes unrelated Undo/Retry feedback.songs_screen.dartbecomes a realSnackBarAction, so it is protected and keeps its callback while routine toasts come and go.Motion, accessibility, and lifetime
easeOutCubic, exit over 200ms, instead of Material 3's narrow fade interval. Reduced motion or the app's zero-animation preference usesAnimationStyle.noAnimation.GlobalKey.Player bar clearance
MainShellwraps its subtree in aSnackBarThemewhose bottominsetPaddingadds the nested bar clearance (150 + extraClearance + 12). The player/navigation bar is a body overlay, soScaffoldcannot infer that reserved space on its own.Tests
test/widgets/flick_snackbar_test.dartcovering the 280/200ms surface animation, replacement during entry without an opaque flash, duplicate-timer refresh, burst coalescing, Undo survival and callback integrity, protected queueing, targeted dismissal, named-status replacement, swipe-to-advance, reduced motion, background pause/resume, screen-reader duration and semantics, keyboard/RTL/2x-text layout, route transitions, and dispose cleanup.Related issue
none
Checklist
flutter analyzepassesflutter testpassescargo test --manifest-path rust/Cargo.tomlpassesflutter run --flavor full)CHANGELOG.mdupdated for user-facing changes