Remove flutter chat #26
1 changed files with 34 additions and 31 deletions
fix audio player size
commit
fd5eaa2725
|
|
@ -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,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue