mirror of
https://github.com/stonega/tsacdop
synced 2025-02-10 00:20:49 +01:00
Bug fixed, fast forward and rewind button UI error.
This commit is contained in:
parent
a40c94e811
commit
6f481ebf16
@ -524,16 +524,18 @@ class _PlaylistWidgetState extends State<PlaylistWidget> {
|
|||||||
borderRadius:
|
borderRadius:
|
||||||
BorderRadius.all(Radius.circular(15.0)),
|
BorderRadius.all(Radius.circular(15.0)),
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
|
var episdoe =
|
||||||
|
episodesToPlay.removeAt(index);
|
||||||
|
episodesToPlay.insert(0, episdoe);
|
||||||
miniPlaylistKey.currentState.removeItem(
|
miniPlaylistKey.currentState.removeItem(
|
||||||
index,
|
index,
|
||||||
(context, animation) => Center(),
|
(context, animation) => Center(),
|
||||||
duration: Duration(milliseconds: 50),
|
duration: Duration(milliseconds: 50),
|
||||||
);
|
);
|
||||||
var episdoe =
|
|
||||||
episodesToPlay.removeAt(index);
|
|
||||||
episodesToPlay.insert(0, episdoe);
|
|
||||||
miniPlaylistKey.currentState.insertItem(0,
|
miniPlaylistKey.currentState.insertItem(0,
|
||||||
duration: Duration(milliseconds: 200));
|
duration: Duration(milliseconds: 100));
|
||||||
|
await Future.delayed(
|
||||||
|
Duration(milliseconds: 150));
|
||||||
await audio
|
await audio
|
||||||
.moveToTop(data.item1[index + 1]);
|
.moveToTop(data.item1[index + 1]);
|
||||||
},
|
},
|
||||||
@ -1008,7 +1010,7 @@ class _ControlPanelState extends State<ControlPanel>
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Container(
|
Container(
|
||||||
padding:
|
padding:
|
||||||
EdgeInsets.only(top: 20, left: 10, right: 10),
|
EdgeInsets.only(top: 20, left: 30, right: 30),
|
||||||
child: SliderTheme(
|
child: SliderTheme(
|
||||||
data: SliderTheme.of(context).copyWith(
|
data: SliderTheme.of(context).copyWith(
|
||||||
activeTrackColor: height <= widget.maxHeight
|
activeTrackColor: height <= widget.maxHeight
|
||||||
@ -1100,26 +1102,36 @@ class _ControlPanelState extends State<ControlPanel>
|
|||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
IconButton(
|
FlatButton(
|
||||||
padding: EdgeInsets.only(right: 10, left: 30),
|
color: Colors.transparent,
|
||||||
onPressed:
|
padding: EdgeInsets.only(right: 10, left: 10),
|
||||||
playing ? () => audio.rewind() : null,
|
shape: RoundedRectangleBorder(
|
||||||
iconSize: 32.0,
|
borderRadius: BorderRadius.circular(100.0),
|
||||||
icon: Icon(Icons.fast_rewind),
|
side: BorderSide(color: Colors.transparent)),
|
||||||
color: Colors.grey[500]),
|
onPressed: playing ? () => audio.rewind() : null,
|
||||||
Selector<AudioPlayerNotifier, int>(
|
child: Row(
|
||||||
selector: (_, audio) => audio.rewindSeconds,
|
children: [
|
||||||
builder: (_, seconds, __) => Padding(
|
Icon(Icons.fast_rewind,
|
||||||
padding: const EdgeInsets.only(top: 5.0),
|
size: 32, color: Colors.grey[500]),
|
||||||
child: Text('$seconds s',
|
SizedBox(width: 5),
|
||||||
style: GoogleFonts.teko(
|
Selector<AudioPlayerNotifier, int>(
|
||||||
textBaseline:
|
selector: (_, audio) =>
|
||||||
TextBaseline.ideographic,
|
audio.rewindSeconds,
|
||||||
textStyle: TextStyle(
|
builder: (_, seconds, __) => Padding(
|
||||||
color: Colors.grey[500],
|
padding:
|
||||||
fontSize: 20),
|
const EdgeInsets.only(top: 5.0),
|
||||||
|
child: Text('$seconds s',
|
||||||
|
style: GoogleFonts.teko(
|
||||||
|
textBaseline:
|
||||||
|
TextBaseline.ideographic,
|
||||||
|
textStyle: TextStyle(
|
||||||
|
color: Colors.grey[500],
|
||||||
|
fontSize: 25),
|
||||||
|
)),
|
||||||
)),
|
)),
|
||||||
)),
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
Container(
|
Container(
|
||||||
margin: EdgeInsets.symmetric(horizontal: 30),
|
margin: EdgeInsets.symmetric(horizontal: 30),
|
||||||
height: 60,
|
height: 60,
|
||||||
@ -1180,25 +1192,34 @@ class _ControlPanelState extends State<ControlPanel>
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Selector<AudioPlayerNotifier, int>(
|
FlatButton(
|
||||||
selector: (_, audio) =>
|
padding: EdgeInsets.only(left: 10.0, right: 10),
|
||||||
audio.fastForwardSeconds,
|
|
||||||
builder: (_, seconds, __) => Padding(
|
|
||||||
padding: const EdgeInsets.only(top: 5.0),
|
|
||||||
child: Text('$seconds s',
|
|
||||||
style: GoogleFonts.teko(
|
|
||||||
textStyle: TextStyle(
|
|
||||||
color: Colors.grey[500],
|
|
||||||
fontSize: 20),
|
|
||||||
)),
|
|
||||||
)),
|
|
||||||
IconButton(
|
|
||||||
padding: EdgeInsets.only(left: 10.0, right: 30),
|
|
||||||
onPressed:
|
onPressed:
|
||||||
playing ? () => audio.fastForward() : null,
|
playing ? () => audio.fastForward() : null,
|
||||||
iconSize: 32.0,
|
color: Colors.transparent,
|
||||||
icon: Icon(Icons.fast_forward),
|
shape: RoundedRectangleBorder(
|
||||||
color: Colors.grey[500],
|
borderRadius: BorderRadius.circular(100.0),
|
||||||
|
side: BorderSide(color: Colors.transparent)),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Selector<AudioPlayerNotifier, int>(
|
||||||
|
selector: (_, audio) =>
|
||||||
|
audio.fastForwardSeconds,
|
||||||
|
builder: (_, seconds, __) => Padding(
|
||||||
|
padding:
|
||||||
|
const EdgeInsets.only(top: 5.0),
|
||||||
|
child: Text('$seconds s',
|
||||||
|
style: GoogleFonts.teko(
|
||||||
|
textStyle: TextStyle(
|
||||||
|
color: Colors.grey[500],
|
||||||
|
fontSize: 25),
|
||||||
|
)),
|
||||||
|
)),
|
||||||
|
SizedBox(width: 10),
|
||||||
|
Icon(Icons.fast_forward,
|
||||||
|
size: 32.0, color: Colors.grey[500]),
|
||||||
|
],
|
||||||
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user