mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-07-29 07:18:49 +02:00
feat(ui): fluid bouncing scroll physics on capable devices
This commit is contained in:
+12
-1
@@ -78,6 +78,17 @@ Locale _resolveSupportedLocale(
|
||||
return _fallbackLocale(supportedLocales);
|
||||
}
|
||||
|
||||
/// iOS-style fluid scroll everywhere: momentum glide + bounce instead of the
|
||||
/// Android clamping stop. Widgets that set explicit physics (queue filter
|
||||
/// PageView, bottom sheets) are unaffected.
|
||||
class _FluidScrollBehavior extends MaterialScrollBehavior {
|
||||
const _FluidScrollBehavior();
|
||||
|
||||
@override
|
||||
ScrollPhysics getScrollPhysics(BuildContext context) =>
|
||||
const BouncingScrollPhysics(parent: AlwaysScrollableScrollPhysics());
|
||||
}
|
||||
|
||||
class SpotiFLACApp extends ConsumerWidget {
|
||||
final bool disableOverscrollEffects;
|
||||
|
||||
@@ -89,7 +100,7 @@ class SpotiFLACApp extends ConsumerWidget {
|
||||
final localeString = ref.watch(settingsProvider.select((s) => s.locale));
|
||||
final scrollBehavior = disableOverscrollEffects
|
||||
? const MaterialScrollBehavior().copyWith(overscroll: false)
|
||||
: null;
|
||||
: const _FluidScrollBehavior();
|
||||
|
||||
Locale? locale;
|
||||
if (localeString != 'system' && localeString.isNotEmpty) {
|
||||
|
||||
Reference in New Issue
Block a user