fix audio player size

This commit is contained in:
Henry Hiles 2026-05-21 12:40:26 -04:00
commit fd5eaa2725
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs

View file

@ -61,39 +61,42 @@ class AudioPlayer extends HookConsumerWidget {
return "$minutes:$seconds"; return "$minutes:$seconds";
} }
return Card( return SizedBox(
color: Theme.of(context).colorScheme.surfaceContainer, height: 60,
child: Padding( child: Card(
padding: EdgeInsetsGeometry.only(left: 8, right: 16), color: Theme.of(context).colorScheme.surfaceContainer,
child: Row( child: Padding(
children: [ padding: EdgeInsetsGeometry.only(left: 8, right: 16),
IconButton( child: Row(
onPressed: player.playOrPause, children: [
icon: Icon( IconButton(
playing.value ? Icons.pause_circle : Icons.play_circle, onPressed: player.playOrPause,
icon: Icon(
playing.value ? Icons.pause_circle : Icons.play_circle,
),
), ),
), SizedBox(width: 8),
SizedBox(width: 8), Text(
Text( format(position.value),
format(position.value), style: Theme.of(context).textTheme.bodySmall,
style: Theme.of(context).textTheme.bodySmall,
),
Expanded(
child: Slider(
min: 0,
max: duration.value.inMilliseconds <= 0
? 1
: duration.value.inMilliseconds.toDouble(),
value: position.value.inMilliseconds.toDouble(),
onChanged: (value) =>
player.seek(Duration(milliseconds: value.toInt())),
), ),
), Expanded(
Text( child: Slider(
format(duration.value), min: 0,
style: Theme.of(context).textTheme.bodySmall, max: duration.value.inMilliseconds <= 0
), ? 1
], : duration.value.inMilliseconds.toDouble(),
value: position.value.inMilliseconds.toDouble(),
onChanged: (value) =>
player.seek(Duration(milliseconds: value.toInt())),
),
),
Text(
format(duration.value),
style: Theme.of(context).textTheme.bodySmall,
),
],
),
), ),
), ),
); );