clean up audio players
This commit is contained in:
parent
bf2aa50556
commit
995afe1412
2 changed files with 32 additions and 32 deletions
|
|
@ -36,29 +36,26 @@ class const AudioPlayer(
|
||||||
return player.dispose;
|
return player.dispose;
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return SizedBox(
|
return Card(
|
||||||
height: 60,
|
color: Theme.of(context).colorScheme.surfaceContainerHigh,
|
||||||
child: Card(
|
child: Padding(
|
||||||
color: Theme.of(context).colorScheme.surfaceContainer,
|
padding: .symmetric(horizontal: 8),
|
||||||
child: Padding(
|
child: PlayerControls(
|
||||||
padding: .symmetric(horizontal: 8),
|
player,
|
||||||
child: PlayerControls(
|
loading: !loaded.value,
|
||||||
player,
|
actions: .new([
|
||||||
loading: !loaded.value,
|
SizedBox(width: 4),
|
||||||
actions: .new([
|
IconButton(
|
||||||
SizedBox(width: 4),
|
onPressed: () => context.saveAttachment(
|
||||||
IconButton(
|
ref,
|
||||||
onPressed: () => context.saveAttachment(
|
uri,
|
||||||
ref,
|
encrypted: encrypted,
|
||||||
uri,
|
filename: filename,
|
||||||
encrypted: encrypted,
|
|
||||||
filename: filename,
|
|
||||||
),
|
|
||||||
tooltip: "Download",
|
|
||||||
icon: Icon(Icons.download),
|
|
||||||
),
|
),
|
||||||
]),
|
tooltip: "Download",
|
||||||
),
|
icon: Icon(Icons.download),
|
||||||
|
),
|
||||||
|
]),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,8 @@ class const PlayerControls(
|
||||||
? Column(
|
? Column(
|
||||||
mainAxisSize: .min,
|
mainAxisSize: .min,
|
||||||
children: [
|
children: [
|
||||||
slider(padding: const .symmetric(horizontal: 12)),
|
SizedBox(height: 12),
|
||||||
|
slider(padding: const .symmetric(horizontal: 16)),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
playButton,
|
playButton,
|
||||||
|
|
@ -94,15 +95,17 @@ class const PlayerControls(
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
: Row(
|
: IntrinsicHeight(
|
||||||
children: [
|
child: Row(
|
||||||
playButton,
|
children: [
|
||||||
SizedBox(width: 8),
|
playButton,
|
||||||
Text(format(position), style: textStyle),
|
SizedBox(width: 8),
|
||||||
Expanded(child: slider()),
|
Text(format(position), style: textStyle),
|
||||||
Text(format(duration), style: textStyle),
|
Expanded(child: slider()),
|
||||||
...actions,
|
Text(format(duration), style: textStyle),
|
||||||
],
|
...actions,
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue