feat: update just audio
This commit is contained in:
parent
79f06e27ec
commit
49a70fb833
|
@ -124,7 +124,7 @@ class _EpisodeDetailState extends State<EpisodeDetail> {
|
||||||
pinned: true,
|
pinned: true,
|
||||||
title: _showTitle
|
title: _showTitle
|
||||||
? Text(
|
? Text(
|
||||||
widget.episodeItem!.title!,
|
widget.episodeItem?.title ?? '',
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
)
|
)
|
||||||
|
@ -133,8 +133,7 @@ class _EpisodeDetailState extends State<EpisodeDetail> {
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 15,
|
fontSize: 15,
|
||||||
color:
|
color: context.textColor!.withOpacity(0.7)),
|
||||||
context.textColor!.withOpacity(0.7)),
|
|
||||||
),
|
),
|
||||||
leading: CustomBackButton(),
|
leading: CustomBackButton(),
|
||||||
elevation: _showTitle ? 1 : 0,
|
elevation: _showTitle ? 1 : 0,
|
||||||
|
@ -164,8 +163,7 @@ class _EpisodeDetailState extends State<EpisodeDetail> {
|
||||||
s.published(DateFormat.yMMMd().format(
|
s.published(DateFormat.yMMMd().format(
|
||||||
DateTime.fromMillisecondsSinceEpoch(
|
DateTime.fromMillisecondsSinceEpoch(
|
||||||
widget.episodeItem!.pubDate!))),
|
widget.episodeItem!.pubDate!))),
|
||||||
style:
|
style: TextStyle(color: context.accentColor)),
|
||||||
TextStyle(color: context.accentColor)),
|
|
||||||
SizedBox(width: 10),
|
SizedBox(width: 10),
|
||||||
if (widget.episodeItem!.explicit == 1)
|
if (widget.episodeItem!.explicit == 1)
|
||||||
Text('E',
|
Text('E',
|
||||||
|
@ -177,8 +175,8 @@ class _EpisodeDetailState extends State<EpisodeDetail> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.symmetric(
|
padding:
|
||||||
horizontal: 20, vertical: 5),
|
EdgeInsets.symmetric(horizontal: 20, vertical: 5),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
if (widget.episodeItem!.duration != 0)
|
if (widget.episodeItem!.duration != 0)
|
||||||
|
@ -189,8 +187,8 @@ class _EpisodeDetailState extends State<EpisodeDetail> {
|
||||||
Radius.circular(16.0))),
|
Radius.circular(16.0))),
|
||||||
height: 28.0,
|
height: 28.0,
|
||||||
margin: EdgeInsets.only(right: 10.0),
|
margin: EdgeInsets.only(right: 10.0),
|
||||||
padding: EdgeInsets.symmetric(
|
padding:
|
||||||
horizontal: 10.0),
|
EdgeInsets.symmetric(horizontal: 10.0),
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: Text(
|
child: Text(
|
||||||
s.minsCount(
|
s.minsCount(
|
||||||
|
@ -198,8 +196,7 @@ class _EpisodeDetailState extends State<EpisodeDetail> {
|
||||||
),
|
),
|
||||||
style: TextStyle(color: Colors.black),
|
style: TextStyle(color: Colors.black),
|
||||||
)),
|
)),
|
||||||
if (widget.episodeItem!.enclosureLength !=
|
if (widget.episodeItem!.enclosureLength != null &&
|
||||||
null &&
|
|
||||||
widget.episodeItem!.enclosureLength != 0)
|
widget.episodeItem!.enclosureLength != 0)
|
||||||
Container(
|
Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
|
@ -227,18 +224,18 @@ class _EpisodeDetailState extends State<EpisodeDetail> {
|
||||||
snapshot.data!.seconds! > 10) {
|
snapshot.data!.seconds! > 10) {
|
||||||
return ButtonTheme(
|
return ButtonTheme(
|
||||||
height: 28,
|
height: 28,
|
||||||
padding: EdgeInsets.symmetric(
|
padding:
|
||||||
horizontal: 0),
|
EdgeInsets.symmetric(horizontal: 0),
|
||||||
child: OutlineButton(
|
child: OutlinedButton(
|
||||||
shape: RoundedRectangleBorder(
|
style: OutlinedButton.styleFrom(
|
||||||
borderRadius:
|
shape: RoundedRectangleBorder(
|
||||||
BorderRadius.circular(
|
borderRadius:
|
||||||
100.0),
|
BorderRadius.circular(
|
||||||
side: BorderSide(
|
100.0),
|
||||||
color:
|
side: BorderSide(
|
||||||
context.accentColor)),
|
color:
|
||||||
highlightedBorderColor:
|
context.accentColor)),
|
||||||
Colors.green[700],
|
),
|
||||||
onPressed: () => audio.episodeLoad(
|
onPressed: () => audio.episodeLoad(
|
||||||
widget.episodeItem,
|
widget.episodeItem,
|
||||||
startPosition:
|
startPosition:
|
||||||
|
@ -258,8 +255,7 @@ class _EpisodeDetailState extends State<EpisodeDetail> {
|
||||||
),
|
),
|
||||||
SizedBox(width: 5),
|
SizedBox(width: 5),
|
||||||
Text(
|
Text(
|
||||||
snapshot
|
snapshot.data!.seconds!.toTime,
|
||||||
.data!.seconds!.toTime,
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
@ -275,11 +271,10 @@ class _EpisodeDetailState extends State<EpisodeDetail> {
|
||||||
ShowNote(episode: widget.episodeItem),
|
ShowNote(episode: widget.episodeItem),
|
||||||
Selector<AudioPlayerNotifier,
|
Selector<AudioPlayerNotifier,
|
||||||
Tuple2<bool, PlayerHeight?>>(
|
Tuple2<bool, PlayerHeight?>>(
|
||||||
selector: (_, audio) => Tuple2(
|
selector: (_, audio) =>
|
||||||
audio.playerRunning, audio.playerHeight),
|
Tuple2(audio.playerRunning, audio.playerHeight),
|
||||||
builder: (_, data, __) {
|
builder: (_, data, __) {
|
||||||
var height =
|
var height = kMinPlayerHeight[data.item2!.index];
|
||||||
kMinPlayerHeight[data.item2!.index];
|
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
height: data.item1 ? height : 0,
|
height: data.item1 ? height : 0,
|
||||||
);
|
);
|
||||||
|
@ -560,13 +555,13 @@ class __MenuBarState extends State<_MenuBar> {
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Text(s!.play.toUpperCase(),
|
Text(s!.play.toUpperCase(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Theme.of(context).accentColor,
|
color: context.accentColor,
|
||||||
fontSize: 15,
|
fontSize: 15,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
)),
|
)),
|
||||||
Icon(
|
Icon(
|
||||||
Icons.play_arrow,
|
Icons.play_arrow,
|
||||||
color: Theme.of(context).accentColor,
|
color: context.accentColor,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
|
@ -349,13 +349,15 @@ class LastPosition extends StatelessWidget {
|
||||||
)
|
)
|
||||||
: snapshot.data!.seconds! < 10
|
: snapshot.data!.seconds! < 10
|
||||||
? Center()
|
? Center()
|
||||||
: OutlineButton(
|
: OutlinedButton(
|
||||||
shape: RoundedRectangleBorder(
|
style: OutlinedButton.styleFrom(
|
||||||
borderRadius:
|
shape: RoundedRectangleBorder(
|
||||||
BorderRadius.circular(100.0),
|
borderRadius:
|
||||||
side: BorderSide(
|
BorderRadius.circular(100.0),
|
||||||
color: context.accentColor)),
|
side: BorderSide(
|
||||||
highlightedBorderColor: Colors.green[700],
|
color: context.accentColor)),
|
||||||
|
),
|
||||||
|
// highlightedBorderColor: Colors.green[700],
|
||||||
onPressed: () => audio.seekTo(
|
onPressed: () => audio.seekTo(
|
||||||
(snapshot.data!.seconds! * 1000)
|
(snapshot.data!.seconds! * 1000)
|
||||||
.toInt()),
|
.toInt()),
|
||||||
|
@ -931,11 +933,14 @@ class _ChaptersWidgetState extends State<ChaptersWidget> {
|
||||||
child: ButtonTheme(
|
child: ButtonTheme(
|
||||||
height: 28,
|
height: 28,
|
||||||
padding: EdgeInsets.symmetric(horizontal: 0),
|
padding: EdgeInsets.symmetric(horizontal: 0),
|
||||||
child: OutlineButton(
|
child: OutlinedButton(
|
||||||
|
style: OutlinedButton.styleFrom(
|
||||||
|
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(100.0),
|
borderRadius: BorderRadius.circular(100.0),
|
||||||
side: BorderSide(color: context.accentColor)),
|
side: BorderSide(color: context.accentColor)),
|
||||||
highlightedBorderColor: Colors.green[700],
|
),
|
||||||
|
// highlightedBorderColor: Colors.green[700],
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
context
|
context
|
||||||
.read<AudioPlayerNotifier>()
|
.read<AudioPlayerNotifier>()
|
||||||
|
|
|
@ -47,7 +47,7 @@ class _HomeState extends State<Home> with SingleTickerProviderStateMixin {
|
||||||
TabController? _controller;
|
TabController? _controller;
|
||||||
Decoration _getIndicator(BuildContext context) {
|
Decoration _getIndicator(BuildContext context) {
|
||||||
return UnderlineTabIndicator(
|
return UnderlineTabIndicator(
|
||||||
borderSide: BorderSide(color: Theme.of(context).accentColor, width: 3),
|
borderSide: BorderSide(color: context.accentColor, width: 3),
|
||||||
insets: EdgeInsets.only(
|
insets: EdgeInsets.only(
|
||||||
left: 10.0,
|
left: 10.0,
|
||||||
right: 10.0,
|
right: 10.0,
|
||||||
|
@ -96,9 +96,9 @@ class _HomeState extends State<Home> with SingleTickerProviderStateMixin {
|
||||||
return AnnotatedRegion<SystemUiOverlayStyle>(
|
return AnnotatedRegion<SystemUiOverlayStyle>(
|
||||||
value: SystemUiOverlayStyle(
|
value: SystemUiOverlayStyle(
|
||||||
systemNavigationBarIconBrightness:
|
systemNavigationBarIconBrightness:
|
||||||
Theme.of(context).accentColorBrightness,
|
context.brightness,
|
||||||
statusBarIconBrightness: Theme.of(context).accentColorBrightness,
|
statusBarIconBrightness: context.iconBrightness,
|
||||||
systemNavigationBarColor: Theme.of(context).primaryColor,
|
systemNavigationBarColor: context.primaryColor,
|
||||||
),
|
),
|
||||||
child: WillPopScope(
|
child: WillPopScope(
|
||||||
onWillPop: () async {
|
onWillPop: () async {
|
||||||
|
|
|
@ -102,15 +102,17 @@ class DiscoveryPageState extends State<DiscoveryPage> {
|
||||||
child: Center(
|
child: Center(
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
height: 32,
|
height: 32,
|
||||||
child: OutlineButton(
|
child: OutlinedButton(
|
||||||
color: context.accentColor.withOpacity(0.5),
|
style: OutlinedButton.styleFrom(
|
||||||
shape: RoundedRectangleBorder(
|
primary: context.accentColor.withOpacity(0.5),
|
||||||
borderRadius: BorderRadius.circular(100.0),
|
shape: RoundedRectangleBorder(
|
||||||
side: BorderSide(color: Colors.grey[500]!)),
|
borderRadius: BorderRadius.circular(100.0),
|
||||||
highlightedBorderColor: Colors.grey[500],
|
side: BorderSide(color: Colors.grey[500]!)),
|
||||||
disabledTextColor: Colors.grey[500],
|
// highlightedBorderColor: Colors.grey[500],
|
||||||
|
// disabledTextColor: Colors.grey[500],
|
||||||
|
// disabledBorderColor: Colors.grey[500],
|
||||||
|
),
|
||||||
child: Text(context.s!.subscribe),
|
child: Text(context.s!.subscribe),
|
||||||
disabledBorderColor: Colors.grey[500],
|
|
||||||
onPressed: () {}),
|
onPressed: () {}),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -460,11 +462,14 @@ class __TopPodcastListState extends State<_TopPodcastList> {
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(top: 10.0, bottom: 20.0),
|
padding: const EdgeInsets.only(top: 10.0, bottom: 20.0),
|
||||||
child: OutlineButton(
|
child: OutlinedButton(
|
||||||
highlightedBorderColor: context.accentColor,
|
style: OutlinedButton.styleFrom(
|
||||||
splashColor: context.accentColor.withOpacity(0.5),
|
shape: RoundedRectangleBorder(
|
||||||
shape: RoundedRectangleBorder(
|
borderRadius:
|
||||||
borderRadius: BorderRadius.all(Radius.circular(100))),
|
BorderRadius.all(Radius.circular(100))),
|
||||||
|
),
|
||||||
|
// highlightedBorderColor: context.accentColor,
|
||||||
|
// splashColor: context.accentColor.withOpacity(0.5),
|
||||||
child: _loading
|
child: _loading
|
||||||
? SizedBox(
|
? SizedBox(
|
||||||
height: 20,
|
height: 20,
|
||||||
|
|
|
@ -331,12 +331,14 @@ class _RssResultState extends State<RssResult> {
|
||||||
return Container(
|
return Container(
|
||||||
padding: const EdgeInsets.only(top: 10.0, bottom: 20.0),
|
padding: const EdgeInsets.only(top: 10.0, bottom: 20.0),
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: OutlineButton(
|
child: OutlinedButton(
|
||||||
highlightedBorderColor: context.accentColor,
|
style: OutlinedButton.styleFrom(
|
||||||
splashColor: context.accentColor.withOpacity(0.5),
|
// highlightedBorderColor: context.accentColor,
|
||||||
shape: RoundedRectangleBorder(
|
onSurface: context.accentColor.withOpacity(0.5),
|
||||||
borderRadius:
|
shape: RoundedRectangleBorder(
|
||||||
BorderRadius.all(Radius.circular(100))),
|
borderRadius:
|
||||||
|
BorderRadius.all(Radius.circular(100))),
|
||||||
|
),
|
||||||
child: Text(context.s!.loadMore),
|
child: Text(context.s!.loadMore),
|
||||||
onPressed: () => setState(
|
onPressed: () => setState(
|
||||||
() => _loadItems += 10,
|
() => _loadItems += 10,
|
||||||
|
@ -542,11 +544,13 @@ class __ListenNotesSearchState extends State<_ListenNotesSearch> {
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
OutlineButton(
|
OutlinedButton(
|
||||||
highlightedBorderColor: context.accentColor,
|
style: OutlinedButton.styleFrom(
|
||||||
splashColor: context.accentColor.withOpacity(0.5),
|
side: BorderSide(color: context.accentColor),
|
||||||
shape: RoundedRectangleBorder(
|
onSurface: context.accentColor.withOpacity(0.5),
|
||||||
borderRadius: BorderRadius.circular(100)),
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(100)),
|
||||||
|
),
|
||||||
child: _loading
|
child: _loading
|
||||||
? SizedBox(
|
? SizedBox(
|
||||||
height: 20,
|
height: 20,
|
||||||
|
@ -704,11 +708,13 @@ class __PodcastIndexSearchState extends State<_PodcastIndexSearch> {
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
OutlineButton(
|
OutlinedButton(
|
||||||
highlightedBorderColor: context.accentColor,
|
style: OutlinedButton.styleFrom(
|
||||||
splashColor: context.accentColor.withOpacity(0.5),
|
side: BorderSide(color: context.accentColor),
|
||||||
shape: RoundedRectangleBorder(
|
onSurface: context.accentColor.withOpacity(0.5),
|
||||||
borderRadius: BorderRadius.circular(100)),
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(100)),
|
||||||
|
),
|
||||||
child: _loading
|
child: _loading
|
||||||
? SizedBox(
|
? SizedBox(
|
||||||
height: 20,
|
height: 20,
|
||||||
|
@ -991,11 +997,13 @@ class _SearchResultDetailState extends State<SearchResultDetail>
|
||||||
padding: const EdgeInsets.only(top: 10.0, bottom: 20.0),
|
padding: const EdgeInsets.only(top: 10.0, bottom: 20.0),
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
child: OutlineButton(
|
child: OutlinedButton(
|
||||||
highlightedBorderColor: context.accentColor,
|
style: OutlinedButton.styleFrom(
|
||||||
splashColor: context.accentColor.withOpacity(0.5),
|
side: BorderSide(color: context.accentColor),
|
||||||
shape: RoundedRectangleBorder(
|
onSurface: context.accentColor.withOpacity(0.5),
|
||||||
borderRadius: BorderRadius.circular(100)),
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(100)),
|
||||||
|
),
|
||||||
child: _loading
|
child: _loading
|
||||||
? SizedBox(
|
? SizedBox(
|
||||||
height: 20,
|
height: 20,
|
||||||
|
@ -1252,43 +1260,50 @@ class SubscribeButton extends StatelessWidget {
|
||||||
searchState.addPodcast(podcast);
|
searchState.addPodcast(podcast);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Consumer<SearchState>(builder: (_, searchState, __) {
|
return Consumer<SearchState>(
|
||||||
final subscribed = searchState.isSubscribed(onlinePodcast);
|
builder: (_, searchState, __) {
|
||||||
return !subscribed
|
final subscribed = searchState.isSubscribed(onlinePodcast);
|
||||||
? ButtonTheme(
|
return !subscribed
|
||||||
height: 32,
|
? ButtonTheme(
|
||||||
child: OutlineButton(
|
height: 32,
|
||||||
highlightedBorderColor: context.accentColor,
|
child: OutlinedButton(
|
||||||
borderSide: BorderSide(color: context.accentColor),
|
style: OutlinedButton.styleFrom(
|
||||||
shape: RoundedRectangleBorder(
|
side: BorderSide(color: context.accentColor),
|
||||||
borderRadius: BorderRadius.circular(100.0),
|
shape: RoundedRectangleBorder(
|
||||||
side: BorderSide(color: context.accentColor)),
|
borderRadius: BorderRadius.circular(100.0),
|
||||||
splashColor: context.accentColor.withOpacity(0.5),
|
side: BorderSide(color: context.accentColor)),
|
||||||
child: Text(s!.subscribe,
|
onSurface: context.accentColor.withOpacity(0.5),
|
||||||
style: TextStyle(color: context.accentColor)),
|
),
|
||||||
onPressed: () {
|
child: Text(s!.subscribe,
|
||||||
Fluttertoast.showToast(
|
style: TextStyle(color: context.accentColor)),
|
||||||
msg: s.podcastSubscribed,
|
onPressed: () {
|
||||||
gravity: ToastGravity.BOTTOM,
|
Fluttertoast.showToast(
|
||||||
);
|
msg: s.podcastSubscribed,
|
||||||
subscribePodcast(onlinePodcast!);
|
gravity: ToastGravity.BOTTOM,
|
||||||
searchState.addPodcast(onlinePodcast);
|
);
|
||||||
}),
|
subscribePodcast(onlinePodcast!);
|
||||||
)
|
searchState.addPodcast(onlinePodcast);
|
||||||
: ButtonTheme(
|
}),
|
||||||
height: 32,
|
)
|
||||||
child: OutlineButton(
|
: ButtonTheme(
|
||||||
color: context.accentColor.withOpacity(0.5),
|
height: 32,
|
||||||
shape: RoundedRectangleBorder(
|
child: OutlinedButton(
|
||||||
borderRadius: BorderRadius.circular(100.0),
|
style: OutlinedButton.styleFrom(
|
||||||
side: BorderSide(color: Colors.grey[500]!)),
|
primary: context.accentColor.withOpacity(0.5),
|
||||||
highlightedBorderColor: Colors.grey[500],
|
shape: RoundedRectangleBorder(
|
||||||
disabledTextColor: Colors.grey[500],
|
borderRadius: BorderRadius.circular(100.0),
|
||||||
child: Text(s!.subscribe),
|
side: BorderSide(color: Colors.grey[500]!)),
|
||||||
disabledBorderColor: Colors.grey[500],
|
side: BorderSide(
|
||||||
onPressed: () {}),
|
color: Colors.grey[500]!,
|
||||||
);
|
),
|
||||||
});
|
// disabledTextColor: Colors.grey[500],
|
||||||
|
// disabledBorderColor: Colors.grey[500],
|
||||||
|
),
|
||||||
|
child: Text(s!.subscribe),
|
||||||
|
onPressed: () {}),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -181,10 +181,9 @@ class _DataBackupState extends State<DataBackup> {
|
||||||
final s = context.s!;
|
final s = context.s!;
|
||||||
return AnnotatedRegion<SystemUiOverlayStyle>(
|
return AnnotatedRegion<SystemUiOverlayStyle>(
|
||||||
value: SystemUiOverlayStyle(
|
value: SystemUiOverlayStyle(
|
||||||
statusBarIconBrightness: Theme.of(context).accentColorBrightness,
|
statusBarIconBrightness: context.iconBrightness,
|
||||||
systemNavigationBarColor: Theme.of(context).primaryColor,
|
systemNavigationBarColor: Theme.of(context).primaryColor,
|
||||||
systemNavigationBarIconBrightness:
|
systemNavigationBarIconBrightness: context.brightness,
|
||||||
Theme.of(context).accentColorBrightness,
|
|
||||||
),
|
),
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
|
@ -255,11 +254,12 @@ class _DataBackupState extends State<DataBackup> {
|
||||||
style: TextStyle(color: Colors.purple[700])),
|
style: TextStyle(color: Colors.purple[700])),
|
||||||
ButtonTheme(
|
ButtonTheme(
|
||||||
height: 32,
|
height: 32,
|
||||||
child: OutlineButton(
|
child: OutlinedButton(
|
||||||
shape: RoundedRectangleBorder(
|
style: OutlinedButton.styleFrom(
|
||||||
borderRadius: BorderRadius.circular(100.0),
|
shape: RoundedRectangleBorder(
|
||||||
side: BorderSide(color: Colors.purple[700]!)),
|
borderRadius: BorderRadius.circular(100.0),
|
||||||
highlightedBorderColor: Colors.purple[700],
|
side: BorderSide(color: Colors.purple[700]!)),
|
||||||
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
|
@ -365,11 +365,12 @@ class _DataBackupState extends State<DataBackup> {
|
||||||
children: [
|
children: [
|
||||||
ButtonTheme(
|
ButtonTheme(
|
||||||
height: 32,
|
height: 32,
|
||||||
child: OutlineButton(
|
child: OutlinedButton(
|
||||||
shape: RoundedRectangleBorder(
|
style: OutlinedButton.styleFrom(
|
||||||
borderRadius: BorderRadius.circular(100.0),
|
shape: RoundedRectangleBorder(
|
||||||
side: BorderSide(color: Colors.green[700]!)),
|
borderRadius: BorderRadius.circular(100.0),
|
||||||
highlightedBorderColor: Colors.green[700],
|
side: BorderSide(color: Colors.green[700]!)),
|
||||||
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Icon(
|
Icon(
|
||||||
|
@ -390,11 +391,12 @@ class _DataBackupState extends State<DataBackup> {
|
||||||
SizedBox(width: 10),
|
SizedBox(width: 10),
|
||||||
ButtonTheme(
|
ButtonTheme(
|
||||||
height: 32,
|
height: 32,
|
||||||
child: OutlineButton(
|
child: OutlinedButton(
|
||||||
shape: RoundedRectangleBorder(
|
style: OutlinedButton.styleFrom(
|
||||||
borderRadius: BorderRadius.circular(100.0),
|
shape: RoundedRectangleBorder(
|
||||||
side: BorderSide(color: Colors.blue[700]!)),
|
borderRadius: BorderRadius.circular(100.0),
|
||||||
highlightedBorderColor: Colors.blue[700],
|
side: BorderSide(color: Colors.blue[700]!)),
|
||||||
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Icon(
|
Icon(
|
||||||
|
@ -434,11 +436,12 @@ class _DataBackupState extends State<DataBackup> {
|
||||||
child: Wrap(children: [
|
child: Wrap(children: [
|
||||||
ButtonTheme(
|
ButtonTheme(
|
||||||
height: 32,
|
height: 32,
|
||||||
child: OutlineButton(
|
child: OutlinedButton(
|
||||||
shape: RoundedRectangleBorder(
|
style: OutlinedButton.styleFrom(
|
||||||
borderRadius: BorderRadius.circular(100.0),
|
shape: RoundedRectangleBorder(
|
||||||
side: BorderSide(color: Colors.green[700]!)),
|
borderRadius: BorderRadius.circular(100.0),
|
||||||
highlightedBorderColor: Colors.green[700],
|
side: BorderSide(color: Colors.green[700]!)),
|
||||||
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
|
@ -460,11 +463,12 @@ class _DataBackupState extends State<DataBackup> {
|
||||||
SizedBox(width: 10),
|
SizedBox(width: 10),
|
||||||
ButtonTheme(
|
ButtonTheme(
|
||||||
height: 32,
|
height: 32,
|
||||||
child: OutlineButton(
|
child: OutlinedButton(
|
||||||
shape: RoundedRectangleBorder(
|
style: OutlinedButton.styleFrom(
|
||||||
borderRadius: BorderRadius.circular(100.0),
|
shape: RoundedRectangleBorder(
|
||||||
side: BorderSide(color: Colors.blue[700]!)),
|
borderRadius: BorderRadius.circular(100.0),
|
||||||
highlightedBorderColor: Colors.blue[700],
|
side: BorderSide(color: Colors.blue[700]!)),
|
||||||
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
|
@ -486,11 +490,12 @@ class _DataBackupState extends State<DataBackup> {
|
||||||
SizedBox(width: 10),
|
SizedBox(width: 10),
|
||||||
ButtonTheme(
|
ButtonTheme(
|
||||||
height: 32,
|
height: 32,
|
||||||
child: OutlineButton(
|
child: OutlinedButton(
|
||||||
highlightedBorderColor: Colors.red[700],
|
style: OutlinedButton.styleFrom(
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(100.0),
|
borderRadius: BorderRadius.circular(100.0),
|
||||||
side: BorderSide(color: Colors.red[700]!)),
|
side: BorderSide(color: Colors.red[700]!)),
|
||||||
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
|
@ -815,11 +820,12 @@ class __LoginGpodderState extends State<_LoginGpodder> {
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Center(
|
Center(
|
||||||
child: OutlineButton(
|
child: OutlinedButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
},
|
},
|
||||||
highlightedBorderColor: context.accentColor,
|
style: OutlinedButton.styleFrom(
|
||||||
|
side: BorderSide(color: context.accentColor)),
|
||||||
child: Text(s.back)),
|
child: Text(s.back)),
|
||||||
),
|
),
|
||||||
]),
|
]),
|
||||||
|
@ -987,8 +993,7 @@ class __GpodderInfoState extends State<_GpodderInfo> {
|
||||||
Future<List<String>?> _getLoginInfo() async {
|
Future<List<String>?> _getLoginInfo() async {
|
||||||
final storage = KeyValueStorage(gpodderApiKey);
|
final storage = KeyValueStorage(gpodderApiKey);
|
||||||
final androidInfo = await DeviceInfoPlugin().androidInfo;
|
final androidInfo = await DeviceInfoPlugin().androidInfo;
|
||||||
final deviceInfo =
|
final deviceInfo = await storage.getStringList();
|
||||||
await storage.getStringList();
|
|
||||||
deviceInfo.add("Tsacdop on ${androidInfo.model}");
|
deviceInfo.add("Tsacdop on ${androidInfo.model}");
|
||||||
return deviceInfo;
|
return deviceInfo;
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,6 +52,7 @@ MediaControl rewindControl = MediaControl(
|
||||||
|
|
||||||
/// Sleep timer mode.
|
/// Sleep timer mode.
|
||||||
enum SleepTimerMode { endOfEpisode, timer, undefined }
|
enum SleepTimerMode { endOfEpisode, timer, undefined }
|
||||||
|
|
||||||
enum PlayerHeight { short, mid, tall }
|
enum PlayerHeight { short, mid, tall }
|
||||||
|
|
||||||
class AudioPlayerNotifier extends ChangeNotifier {
|
class AudioPlayerNotifier extends ChangeNotifier {
|
||||||
|
@ -304,9 +305,7 @@ class AudioPlayerNotifier extends ChangeNotifier {
|
||||||
if (state[1] != '') {
|
if (state[1] != '') {
|
||||||
var episode = await _dbHelper.getRssItemWithUrl(state[1]);
|
var episode = await _dbHelper.getRssItemWithUrl(state[1]);
|
||||||
if (episode != null &&
|
if (episode != null &&
|
||||||
((!_playlist!.isQueue &&
|
((!_playlist!.isQueue && _playlist!.contains(episode)) ||
|
||||||
episode != null &&
|
|
||||||
_playlist!.contains(episode)) ||
|
|
||||||
(_playlist!.isQueue &&
|
(_playlist!.isQueue &&
|
||||||
_queue.isNotEmpty &&
|
_queue.isNotEmpty &&
|
||||||
_queue.episodes.first!.title == episode.title))) {
|
_queue.episodes.first!.title == episode.title))) {
|
||||||
|
@ -987,7 +986,16 @@ class CustomAudioHandler extends BaseAudioHandler
|
||||||
with QueueHandler, SeekHandler {
|
with QueueHandler, SeekHandler {
|
||||||
final cacheStorage = KeyValueStorage(cacheMaxKey);
|
final cacheStorage = KeyValueStorage(cacheMaxKey);
|
||||||
final layoutStorage = KeyValueStorage(notificationLayoutKey);
|
final layoutStorage = KeyValueStorage(notificationLayoutKey);
|
||||||
final AudioPlayer _player = AudioPlayer();
|
final _equalizer = AndroidEqualizer();
|
||||||
|
final _loudnessEnhancer = AndroidLoudnessEnhancer();
|
||||||
|
late final AudioPlayer _player = AudioPlayer(
|
||||||
|
audioPipeline: AudioPipeline(
|
||||||
|
androidAudioEffects: [
|
||||||
|
_loudnessEnhancer,
|
||||||
|
_equalizer,
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
bool _interrupted = false;
|
bool _interrupted = false;
|
||||||
int? _layoutIndex;
|
int? _layoutIndex;
|
||||||
bool _stopAtEnd = false;
|
bool _stopAtEnd = false;
|
||||||
|
@ -1007,7 +1015,7 @@ class CustomAudioHandler extends BaseAudioHandler
|
||||||
PublishSubject<Map<String, dynamic>> customEvent = PublishSubject()..add({});
|
PublishSubject<Map<String, dynamic>> customEvent = PublishSubject()..add({});
|
||||||
|
|
||||||
CustomAudioHandler(int cacheMax) {
|
CustomAudioHandler(int cacheMax) {
|
||||||
_player.cacheMax = cacheMax;
|
// _player.cacheMax = cacheMax;
|
||||||
_handleInterruption();
|
_handleInterruption();
|
||||||
_player.currentIndexStream.listen(
|
_player.currentIndexStream.listen(
|
||||||
(index) {
|
(index) {
|
||||||
|
@ -1147,8 +1155,7 @@ class CustomAudioHandler extends BaseAudioHandler
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> play() async {
|
Future<void> play() async {
|
||||||
if (playing == null || playing == false) {
|
if (!playing) {
|
||||||
log('playing');
|
|
||||||
await super.play();
|
await super.play();
|
||||||
await _player.play();
|
await _player.play();
|
||||||
} else {
|
} else {
|
||||||
|
@ -1285,11 +1292,12 @@ class CustomAudioHandler extends BaseAudioHandler
|
||||||
}
|
}
|
||||||
|
|
||||||
Future _setSkipSilence(bool boo) async {
|
Future _setSkipSilence(bool boo) async {
|
||||||
await _player.setSkipSilence(boo);
|
await _player.setSkipSilenceEnabled(boo);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future _setBoostVolume(bool boo, int gain) async {
|
Future _setBoostVolume(bool enabled, int gain) async {
|
||||||
await _player.setBoostVolume(boo, gain);
|
await _loudnessEnhancer.setEnabled(enabled);
|
||||||
|
await _loudnessEnhancer.setTargetGain(1.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<MediaControl> _getControls(int? index) {
|
List<MediaControl> _getControls(int? index) {
|
||||||
|
@ -1301,7 +1309,6 @@ class CustomAudioHandler extends BaseAudioHandler
|
||||||
skipToNextControl,
|
skipToNextControl,
|
||||||
stopControl
|
stopControl
|
||||||
];
|
];
|
||||||
break;
|
|
||||||
case 1:
|
case 1:
|
||||||
return [
|
return [
|
||||||
playing ? pauseControl : playControl,
|
playing ? pauseControl : playControl,
|
||||||
|
@ -1309,7 +1316,6 @@ class CustomAudioHandler extends BaseAudioHandler
|
||||||
skipToNextControl,
|
skipToNextControl,
|
||||||
stopControl
|
stopControl
|
||||||
];
|
];
|
||||||
break;
|
|
||||||
case 2:
|
case 2:
|
||||||
return [
|
return [
|
||||||
rewindControl,
|
rewindControl,
|
||||||
|
@ -1318,7 +1324,6 @@ class CustomAudioHandler extends BaseAudioHandler
|
||||||
stopControl
|
stopControl
|
||||||
];
|
];
|
||||||
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
return [
|
return [
|
||||||
playing ? pauseControl : playControl,
|
playing ? pauseControl : playControl,
|
||||||
|
@ -1326,7 +1331,6 @@ class CustomAudioHandler extends BaseAudioHandler
|
||||||
skipToNextControl,
|
skipToNextControl,
|
||||||
stopControl
|
stopControl
|
||||||
];
|
];
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -154,7 +154,14 @@ class SettingState extends ChangeNotifier {
|
||||||
iconTheme: IconThemeData(color: Colors.black),
|
iconTheme: IconThemeData(color: Colors.black),
|
||||||
systemOverlayStyle: SystemUiOverlayStyle.dark),
|
systemOverlayStyle: SystemUiOverlayStyle.dark),
|
||||||
textTheme: TextTheme(
|
textTheme: TextTheme(
|
||||||
bodyText2: TextStyle(fontSize: 15.0, fontWeight: FontWeight.normal),
|
bodyLarge: TextStyle(
|
||||||
|
fontSize: 17.0,
|
||||||
|
color: Colors.black,
|
||||||
|
fontWeight: FontWeight.normal),
|
||||||
|
bodyMedium: TextStyle(
|
||||||
|
fontSize: 15.0,
|
||||||
|
color: Colors.black,
|
||||||
|
fontWeight: FontWeight.normal),
|
||||||
),
|
),
|
||||||
tabBarTheme: TabBarTheme(
|
tabBarTheme: TabBarTheme(
|
||||||
labelColor: Colors.black,
|
labelColor: Colors.black,
|
||||||
|
@ -178,6 +185,16 @@ class SettingState extends ChangeNotifier {
|
||||||
.copyWith(brightness: Brightness.dark, secondary: _accentSetColor),
|
.copyWith(brightness: Brightness.dark, secondary: _accentSetColor),
|
||||||
brightness: Brightness.light,
|
brightness: Brightness.light,
|
||||||
primaryColorDark: Colors.grey[800],
|
primaryColorDark: Colors.grey[800],
|
||||||
|
textTheme: TextTheme(
|
||||||
|
bodyLarge: TextStyle(
|
||||||
|
fontSize: 17.0,
|
||||||
|
color: Colors.white,
|
||||||
|
fontWeight: FontWeight.normal),
|
||||||
|
bodyMedium: TextStyle(
|
||||||
|
fontSize: 15.0,
|
||||||
|
color: Colors.white,
|
||||||
|
fontWeight: FontWeight.normal),
|
||||||
|
),
|
||||||
scaffoldBackgroundColor:
|
scaffoldBackgroundColor:
|
||||||
_realDark! ? Colors.black87 : Color(0XFF212121),
|
_realDark! ? Colors.black87 : Color(0XFF212121),
|
||||||
primaryColor: _realDark! ? Colors.black : Color(0XFF1B1B1B),
|
primaryColor: _realDark! ? Colors.black : Color(0XFF1B1B1B),
|
||||||
|
|
|
@ -12,7 +12,7 @@ extension ContextExtension on BuildContext {
|
||||||
Color get accentColor => Theme.of(this).colorScheme.secondary;
|
Color get accentColor => Theme.of(this).colorScheme.secondary;
|
||||||
Color get scaffoldBackgroundColor => Theme.of(this).scaffoldBackgroundColor;
|
Color get scaffoldBackgroundColor => Theme.of(this).scaffoldBackgroundColor;
|
||||||
Color get primaryColorDark => Theme.of(this).primaryColorDark;
|
Color get primaryColorDark => Theme.of(this).primaryColorDark;
|
||||||
Color? get textColor => Theme.of(this).textTheme.bodyText1!.color;
|
Color get textColor => textTheme.bodyLarge!.color!;
|
||||||
Color get dialogBackgroundColor => Theme.of(this).dialogBackgroundColor;
|
Color get dialogBackgroundColor => Theme.of(this).dialogBackgroundColor;
|
||||||
Brightness get brightness => Theme.of(this).brightness;
|
Brightness get brightness => Theme.of(this).brightness;
|
||||||
Brightness get iconBrightness => Theme.of(this).colorScheme.brightness;
|
Brightness get iconBrightness => Theme.of(this).colorScheme.brightness;
|
||||||
|
|
|
@ -652,7 +652,7 @@ class _LineLoaderState extends State<LineLoader>
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return CustomPaint(
|
return CustomPaint(
|
||||||
painter: LinePainter(_fraction, Theme.of(context).accentColor));
|
painter: LinePainter(_fraction, context.accentColor));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1116,7 +1116,7 @@ class LayoutButton extends StatelessWidget {
|
||||||
width: 30,
|
width: 30,
|
||||||
child: CustomPaint(
|
child: CustomPaint(
|
||||||
painter:
|
painter:
|
||||||
LayoutPainter(4, context.textTheme.bodyText1!.color),
|
LayoutPainter(4, context.textColor),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
10
pubspec.yaml
10
pubspec.yaml
|
@ -48,15 +48,11 @@ dependencies:
|
||||||
tuple: ^2.0.0
|
tuple: ^2.0.0
|
||||||
url_launcher: ^6.0.3
|
url_launcher: ^6.0.3
|
||||||
uuid: ^3.0.4
|
uuid: ^3.0.4
|
||||||
workmanager: ^0.4.1
|
workmanager: ^0.5.0
|
||||||
wc_flutter_share: ^0.4.0
|
wc_flutter_share: ^0.4.0
|
||||||
xml: ^5.2.0
|
xml: ^5.2.0
|
||||||
audio_service: ^0.18.0
|
audio_service: ^0.18.0
|
||||||
just_audio:
|
just_audio: ^0.9.23
|
||||||
git:
|
|
||||||
url: https://github.com/stonega/just_audio_origin.git
|
|
||||||
ref: update
|
|
||||||
path: just_audio
|
|
||||||
flutter_downloader:
|
flutter_downloader:
|
||||||
git:
|
git:
|
||||||
url: https://github.com/stonega/flutter_downloader.git
|
url: https://github.com/stonega/flutter_downloader.git
|
||||||
|
@ -74,8 +70,6 @@ dependencies:
|
||||||
path_provider_android: ^2.0.14
|
path_provider_android: ^2.0.14
|
||||||
|
|
||||||
dependency_overrides:
|
dependency_overrides:
|
||||||
meta: 1.3.0
|
|
||||||
shared_preferences: 2.0.0
|
|
||||||
linkify:
|
linkify:
|
||||||
git:
|
git:
|
||||||
url: https://github.com/stonega/linkify.git
|
url: https://github.com/stonega/linkify.git
|
||||||
|
|
Loading…
Reference in New Issue