mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 07:55:18 +00:00
chore(player-controls): add bottom space to life up player control buttons
This commit is contained in:
parent
d5ff927c72
commit
74d56792c6
@ -31,25 +31,26 @@ class PlayerControls extends HookConsumerWidget {
|
||||
child: Column(
|
||||
children: [
|
||||
StreamBuilder<Duration>(
|
||||
stream: playback.player.onPositionChanged,
|
||||
builder: (context, snapshot) {
|
||||
final totalMinutes = PrimitiveUtils.zeroPadNumStr(
|
||||
duration.inMinutes.remainder(60));
|
||||
final totalSeconds = PrimitiveUtils.zeroPadNumStr(
|
||||
duration.inSeconds.remainder(60));
|
||||
final currentMinutes = snapshot.hasData
|
||||
? PrimitiveUtils.zeroPadNumStr(
|
||||
snapshot.data!.inMinutes.remainder(60))
|
||||
: "00";
|
||||
final currentSeconds = snapshot.hasData
|
||||
? PrimitiveUtils.zeroPadNumStr(
|
||||
snapshot.data!.inSeconds.remainder(60))
|
||||
: "00";
|
||||
stream: playback.player.onPositionChanged,
|
||||
builder: (context, snapshot) {
|
||||
final totalMinutes = PrimitiveUtils.zeroPadNumStr(
|
||||
duration.inMinutes.remainder(60));
|
||||
final totalSeconds = PrimitiveUtils.zeroPadNumStr(
|
||||
duration.inSeconds.remainder(60));
|
||||
final currentMinutes = snapshot.hasData
|
||||
? PrimitiveUtils.zeroPadNumStr(
|
||||
snapshot.data!.inMinutes.remainder(60))
|
||||
: "00";
|
||||
final currentSeconds = snapshot.hasData
|
||||
? PrimitiveUtils.zeroPadNumStr(
|
||||
snapshot.data!.inSeconds.remainder(60))
|
||||
: "00";
|
||||
|
||||
final sliderMax = duration.inSeconds;
|
||||
final sliderValue = snapshot.data?.inSeconds ?? 0;
|
||||
final sliderMax = duration.inSeconds;
|
||||
final sliderValue = snapshot.data?.inSeconds ?? 0;
|
||||
|
||||
return HookBuilder(builder: (context) {
|
||||
return HookBuilder(
|
||||
builder: (context) {
|
||||
final progressStatic =
|
||||
(sliderMax == 0 || sliderValue > sliderMax)
|
||||
? 0
|
||||
@ -84,7 +85,9 @@ class PlayerControls extends HookConsumerWidget {
|
||||
activeColor: iconColor,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 8.0,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
@ -97,8 +100,10 @@ class PlayerControls extends HookConsumerWidget {
|
||||
),
|
||||
],
|
||||
);
|
||||
});
|
||||
}),
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
@ -122,7 +127,11 @@ class PlayerControls extends HookConsumerWidget {
|
||||
}),
|
||||
IconButton(
|
||||
icon: playback.status == PlaybackStatus.loading
|
||||
? const CircularProgressIndicator()
|
||||
? const SizedBox(
|
||||
height: 20,
|
||||
width: 20,
|
||||
child: CircularProgressIndicator(),
|
||||
)
|
||||
: Icon(
|
||||
playback.isPlaying
|
||||
? Icons.pause_rounded
|
||||
@ -151,6 +160,7 @@ class PlayerControls extends HookConsumerWidget {
|
||||
)
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 5)
|
||||
],
|
||||
));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user