Change playlist icon

Move versioncode to pubspec
Check if skip in erroe state
This commit is contained in:
stonegate 2020-06-14 16:03:03 +08:00
parent 9740113dfe
commit 4d49bf086e
4 changed files with 29 additions and 10 deletions

View File

@ -49,7 +49,7 @@ android {
applicationId "com.stonegate.tsacdop"
minSdkVersion 19
targetSdkVersion 29
versionCode 17
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

View File

@ -12,6 +12,7 @@ import '../state/audiostate.dart';
import '../type/episodebrief.dart';
import '../util/context_extension.dart';
import '../util/custompaint.dart';
import '../util/colorize.dart';
class PlaylistPage extends StatefulWidget {
@override
@ -306,6 +307,9 @@ class _DismissibleContainerState extends State<DismissibleContainer> {
@override
Widget build(BuildContext context) {
var audio = Provider.of<AudioPlayerNotifier>(context, listen: false);
Color _c = (Theme.of(context).brightness == Brightness.light)
? widget.episode.primaryColor.colorizedark()
: widget.episode.primaryColor.colorizeLight();
return AnimatedContainer(
duration: Duration(milliseconds: 300),
alignment: Alignment.center,
@ -381,10 +385,18 @@ class _DismissibleContainerState extends State<DismissibleContainer> {
overflow: TextOverflow.ellipsis,
),
),
leading: CircleAvatar(
//backgroundColor: _c.withOpacity(0.5),
backgroundImage:
FileImage(File("${widget.episode.imagePath}")),
leading: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
Icon(Icons.unfold_more, color: _c),
CircleAvatar(
//backgroundColor: _c.withOpacity(0.5),
backgroundImage:
FileImage(File("${widget.episode.imagePath}")),
),
],
),
subtitle: Container(
padding: EdgeInsets.only(top: 5, bottom: 10),
@ -418,7 +430,7 @@ class _DismissibleContainerState extends State<DismissibleContainer> {
],
),
),
trailing: Icon(Icons.menu),
//trailing: Icon(Icons.menu),
),
// Divider(
// height: 2,

View File

@ -422,7 +422,7 @@ class AudioPlayerNotifier extends ChangeNotifier {
}
playNext() async {
AudioService.skipToNext();
await AudioService.skipToNext();
}
addToPlaylist(EpisodeBrief episode) async {
@ -678,7 +678,7 @@ class AudioPlayerTask extends BackgroundAudioTask {
});
var eventSubscription = _audioPlayer.playbackEventStream.listen((event) {
if (event.playbackError != null) {
_setState(state: BasicPlaybackState.error);
_setState(state: _skipState ?? BasicPlaybackState.error);
}
BasicPlaybackState state;
if (event.buffering) {
@ -818,7 +818,14 @@ class AudioPlayerTask extends BackgroundAudioTask {
@override
void onClick(MediaButton button) {
playPause();
if (button == MediaButton.media)
playPause();
else if (button == MediaButton.next)
_audioPlayer.seek(Duration(
milliseconds: AudioServiceBackground.state.position + 30 * 1000));
else if (button == MediaButton.previous)
_audioPlayer.seek(Duration(
milliseconds: AudioServiceBackground.state.position - 10 * 1000));
}
@override

View File

@ -1,7 +1,7 @@
name: tsacdop
description: An easy-use podacasts player.
version: 0.3.4
version: 0.3.4+17
environment:
sdk: ">=2.6.0 <3.0.0"