clean up audio players

This commit is contained in:
Henry Hiles 2026-11-07 22:40:56 -05:00
commit 995afe1412
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs
2 changed files with 32 additions and 32 deletions

View file

@ -36,29 +36,26 @@ class const AudioPlayer(
return player.dispose;
}, []);
return SizedBox(
height: 60,
child: Card(
color: Theme.of(context).colorScheme.surfaceContainer,
child: Padding(
padding: .symmetric(horizontal: 8),
child: PlayerControls(
player,
loading: !loaded.value,
actions: .new([
SizedBox(width: 4),
IconButton(
onPressed: () => context.saveAttachment(
ref,
uri,
encrypted: encrypted,
filename: filename,
),
tooltip: "Download",
icon: Icon(Icons.download),
return Card(
color: Theme.of(context).colorScheme.surfaceContainerHigh,
child: Padding(
padding: .symmetric(horizontal: 8),
child: PlayerControls(
player,
loading: !loaded.value,
actions: .new([
SizedBox(width: 4),
IconButton(
onPressed: () => context.saveAttachment(
ref,
uri,
encrypted: encrypted,
filename: filename,
),
]),
),
tooltip: "Download",
icon: Icon(Icons.download),
),
]),
),
),
);

View file

@ -77,7 +77,8 @@ class const PlayerControls(
? Column(
mainAxisSize: .min,
children: [
slider(padding: const .symmetric(horizontal: 12)),
SizedBox(height: 12),
slider(padding: const .symmetric(horizontal: 16)),
Row(
children: [
playButton,
@ -94,15 +95,17 @@ class const PlayerControls(
),
],
)
: Row(
children: [
playButton,
SizedBox(width: 8),
Text(format(position), style: textStyle),
Expanded(child: slider()),
Text(format(duration), style: textStyle),
...actions,
],
: IntrinsicHeight(
child: Row(
children: [
playButton,
SizedBox(width: 8),
Text(format(position), style: textStyle),
Expanded(child: slider()),
Text(format(duration), style: textStyle),
...actions,
],
),
),
);
}