mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-12 23:45:18 +00:00
fix: PlayerOverlay not hiding when not playing and unneeded bottom space in TrackTableView
This commit is contained in:
parent
0ca97b495f
commit
0ebac05a4b
@ -21,6 +21,14 @@ class PlayerOverlay extends HookConsumerWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, ref) {
|
Widget build(BuildContext context, ref) {
|
||||||
final paletteColor = usePaletteColor(albumArt, ref);
|
final paletteColor = usePaletteColor(albumArt, ref);
|
||||||
|
final canShow = ref.watch(
|
||||||
|
playbackProvider.select(
|
||||||
|
(s) =>
|
||||||
|
s.track != null ||
|
||||||
|
s.isPlaying ||
|
||||||
|
s.status == PlaybackStatus.loading,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
final onNext = useNextTrack(ref);
|
final onNext = useNextTrack(ref);
|
||||||
final onPrevious = usePreviousTrack(ref);
|
final onPrevious = usePreviousTrack(ref);
|
||||||
@ -38,9 +46,9 @@ class PlayerOverlay extends HookConsumerWidget {
|
|||||||
child: BackdropFilter(
|
child: BackdropFilter(
|
||||||
filter: ImageFilter.blur(sigmaX: 15, sigmaY: 15),
|
filter: ImageFilter.blur(sigmaX: 15, sigmaY: 15),
|
||||||
child: AnimatedContainer(
|
child: AnimatedContainer(
|
||||||
duration: const Duration(milliseconds: 500),
|
duration: const Duration(milliseconds: 250),
|
||||||
width: MediaQuery.of(context).size.width,
|
width: MediaQuery.of(context).size.width,
|
||||||
height: 50,
|
height: canShow ? 50 : 0,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: paletteColor.color.withOpacity(.7),
|
color: paletteColor.color.withOpacity(.7),
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
@ -49,6 +57,9 @@ class PlayerOverlay extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
borderRadius: BorderRadius.circular(5),
|
borderRadius: BorderRadius.circular(5),
|
||||||
),
|
),
|
||||||
|
child: AnimatedOpacity(
|
||||||
|
duration: const Duration(milliseconds: 250),
|
||||||
|
opacity: canShow ? 1 : 0,
|
||||||
child: Material(
|
child: Material(
|
||||||
type: MaterialType.transparency,
|
type: MaterialType.transparency,
|
||||||
child: Row(
|
child: Row(
|
||||||
@ -103,6 +114,7 @@ class PlayerOverlay extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -233,7 +233,6 @@ class TrackCollectionView extends HookConsumerWidget {
|
|||||||
onTrackPlayButtonPressed: onPlay,
|
onTrackPlayButtonPressed: onPlay,
|
||||||
playlistId: id,
|
playlistId: id,
|
||||||
userPlaylist: isOwned,
|
userPlaylist: isOwned,
|
||||||
bottomSpace: bottomSpace,
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
error: (error, _) =>
|
error: (error, _) =>
|
||||||
|
@ -15,7 +15,6 @@ class TracksTableView extends HookConsumerWidget {
|
|||||||
final List<Track> tracks;
|
final List<Track> tracks;
|
||||||
final bool userPlaylist;
|
final bool userPlaylist;
|
||||||
final String? playlistId;
|
final String? playlistId;
|
||||||
final bool bottomSpace;
|
|
||||||
final bool isSliver;
|
final bool isSliver;
|
||||||
|
|
||||||
final Widget? heading;
|
final Widget? heading;
|
||||||
@ -26,7 +25,6 @@ class TracksTableView extends HookConsumerWidget {
|
|||||||
this.userPlaylist = false,
|
this.userPlaylist = false,
|
||||||
this.playlistId,
|
this.playlistId,
|
||||||
this.heading,
|
this.heading,
|
||||||
this.bottomSpace = false,
|
|
||||||
this.isSliver = true,
|
this.isSliver = true,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@ -191,7 +189,6 @@ class TracksTableView extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}).toList(),
|
}).toList(),
|
||||||
if (bottomSpace) const SizedBox(height: 70),
|
|
||||||
];
|
];
|
||||||
|
|
||||||
if (isSliver) {
|
if (isSliver) {
|
||||||
|
Loading…
Reference in New Issue
Block a user