mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-15 00:25:17 +00:00
feat: make snackbar floating
This commit is contained in:
parent
31b9249cc8
commit
9dbb8171a6
@ -535,7 +535,8 @@ class PlaylistQueueNotifier extends PersistedStateNotifier<PlaylistQueue?> {
|
||||
state = state!.copyWith(tracks: Set.from(tracks), active: active);
|
||||
}
|
||||
|
||||
Future<void> updatePalette() async {
|
||||
Future<void> updatePalette() {
|
||||
return Future.microtask(() async {
|
||||
final palette = await PaletteGenerator.fromImageProvider(
|
||||
UniversalImage.imageProvider(
|
||||
TypeConversionUtils.image_X_UrlString(
|
||||
@ -547,6 +548,7 @@ class PlaylistQueueNotifier extends PersistedStateNotifier<PlaylistQueue?> {
|
||||
),
|
||||
);
|
||||
ref.read(paletteProvider.notifier).state = palette;
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
@ -555,6 +557,8 @@ class PlaylistQueueNotifier extends PersistedStateNotifier<PlaylistQueue?> {
|
||||
state != null &&
|
||||
state.active != this.state?.active) {
|
||||
updatePalette();
|
||||
} else if (state == null && ref.read(paletteProvider) != null) {
|
||||
ref.read(paletteProvider.notifier).state = null;
|
||||
}
|
||||
super.state = state;
|
||||
}
|
||||
|
@ -41,5 +41,11 @@ ThemeData theme(Color seed, Brightness brightness) {
|
||||
color: scheme.surface,
|
||||
elevation: 4,
|
||||
),
|
||||
snackBarTheme: SnackBarThemeData(
|
||||
behavior: SnackBarBehavior.floating,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)),
|
||||
backgroundColor: scheme.onSurface,
|
||||
contentTextStyle: TextStyle(color: scheme.surface),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user