mirror of
https://github.com/stonega/tsacdop
synced 2025-03-05 19:58:11 +01:00
modified: .circleci/config.yml
This commit is contained in:
parent
860e2ed626
commit
d23502ed97
@ -21,8 +21,5 @@ jobs:
|
||||
- run:
|
||||
name: Build the Android version
|
||||
command: flutter build appbundle --no-shrink
|
||||
- run:
|
||||
name: Build the Android apks
|
||||
command: flutter build apk --split-per-abi --no-shrink
|
||||
- store_artifacts:
|
||||
path: build/app/outputs/
|
@ -18,6 +18,7 @@ import '../util/context_extension.dart';
|
||||
import '../util/custompaint.dart';
|
||||
import '../state/download_state.dart';
|
||||
import '../state/podcast_group.dart';
|
||||
import '../state/subscribe_podcast.dart';
|
||||
import 'playlist.dart';
|
||||
import 'importompl.dart';
|
||||
import 'audioplayer.dart';
|
||||
@ -473,199 +474,214 @@ class _RecentUpdateState extends State<_RecentUpdate>
|
||||
snapshot.data.length == _top) _loadMoreEpisode();
|
||||
return true;
|
||||
},
|
||||
child: CustomScrollView(
|
||||
key: PageStorageKey<String>('update'),
|
||||
physics: const AlwaysScrollableScrollPhysics(),
|
||||
slivers: <Widget>[
|
||||
SliverToBoxAdapter(
|
||||
child: Container(
|
||||
height: 40,
|
||||
color: context.primaryColor,
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Consumer<GroupList>(
|
||||
builder: (context, groupList, child) =>
|
||||
Material(
|
||||
color: Colors.transparent,
|
||||
child: PopupMenuButton<String>(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(10))),
|
||||
elevation: 1,
|
||||
tooltip: 'Groups fliter',
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 20),
|
||||
height: 50,
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
Text(_groupName),
|
||||
Padding(
|
||||
padding:
|
||||
EdgeInsets.symmetric(
|
||||
horizontal: 5),
|
||||
),
|
||||
Icon(
|
||||
LineIcons.filter_solid,
|
||||
size: 18,
|
||||
)
|
||||
],
|
||||
)),
|
||||
itemBuilder: (context) => [
|
||||
PopupMenuItem(
|
||||
child: Text('All'),
|
||||
value: 'All')
|
||||
]..addAll(groupList.groups
|
||||
.map<PopupMenuEntry<String>>(
|
||||
(e) => PopupMenuItem(
|
||||
value: e.name,
|
||||
child: Text(e.name)))
|
||||
.toList()),
|
||||
onSelected: (value) {
|
||||
if (value == 'All') {
|
||||
setState(() {
|
||||
_groupName = 'All';
|
||||
_group = ['All'];
|
||||
});
|
||||
} else {
|
||||
groupList.groups.forEach((group) {
|
||||
if (group.name == value) {
|
||||
child: Selector<SubscribeWorker, bool>(
|
||||
selector: (_, worker) => worker.created,
|
||||
builder: (context, created, child) {
|
||||
return CustomScrollView(
|
||||
key: PageStorageKey<String>('update'),
|
||||
physics: const AlwaysScrollableScrollPhysics(),
|
||||
slivers: <Widget>[
|
||||
SliverToBoxAdapter(
|
||||
child: Container(
|
||||
height: 40,
|
||||
color: context.primaryColor,
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Consumer<GroupList>(
|
||||
builder:
|
||||
(context, groupList, child) =>
|
||||
Material(
|
||||
color: Colors.transparent,
|
||||
child: PopupMenuButton<String>(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.all(
|
||||
Radius.circular(10))),
|
||||
elevation: 1,
|
||||
tooltip: 'Groups fliter',
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 20),
|
||||
height: 50,
|
||||
child: Row(
|
||||
mainAxisSize:
|
||||
MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
Text(_groupName),
|
||||
Padding(
|
||||
padding: EdgeInsets
|
||||
.symmetric(
|
||||
horizontal: 5),
|
||||
),
|
||||
Icon(
|
||||
LineIcons.filter_solid,
|
||||
size: 18,
|
||||
)
|
||||
],
|
||||
)),
|
||||
itemBuilder: (context) => [
|
||||
PopupMenuItem(
|
||||
child: Text('All'),
|
||||
value: 'All')
|
||||
]..addAll(groupList.groups
|
||||
.map<PopupMenuEntry<String>>(
|
||||
(e) => PopupMenuItem(
|
||||
value: e.name,
|
||||
child: Text(e.name)))
|
||||
.toList()),
|
||||
onSelected: (value) {
|
||||
if (value == 'All') {
|
||||
setState(() {
|
||||
_groupName = value;
|
||||
_group = group.podcastList;
|
||||
_groupName = 'All';
|
||||
_group = ['All'];
|
||||
});
|
||||
} else {
|
||||
groupList.groups
|
||||
.forEach((group) {
|
||||
if (group.name == value) {
|
||||
setState(() {
|
||||
_groupName = value;
|
||||
_group =
|
||||
group.podcastList;
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
FutureBuilder<int>(
|
||||
future: _getUpdateCounts(_group),
|
||||
initialData: 0,
|
||||
builder: (context, snapshot) {
|
||||
return snapshot.data != 0
|
||||
? Material(
|
||||
color: Colors.transparent,
|
||||
child: IconButton(
|
||||
tooltip:
|
||||
'Add new episodes to playlist',
|
||||
icon:
|
||||
// Icon(Icons.playlist_add),
|
||||
SizedBox(
|
||||
height: 16,
|
||||
width: 21,
|
||||
child: CustomPaint(
|
||||
painter: AddToPlaylistPainter(
|
||||
context
|
||||
.textTheme
|
||||
.bodyText1
|
||||
.color,
|
||||
Colors
|
||||
.red))),
|
||||
onPressed: () async {
|
||||
await audio
|
||||
.addNewEpisode(
|
||||
_group);
|
||||
if (mounted)
|
||||
setState(() {});
|
||||
Fluttertoast.showToast(
|
||||
msg: _groupName ==
|
||||
'All'
|
||||
? '${snapshot.data} episode added to playlist'
|
||||
: '${snapshot.data} episode in $_groupName added to playlist',
|
||||
gravity: ToastGravity
|
||||
.BOTTOM,
|
||||
);
|
||||
}),
|
||||
)
|
||||
: Material(
|
||||
color: Colors.transparent,
|
||||
child: IconButton(
|
||||
tooltip:
|
||||
'Add new episodes to playlist',
|
||||
icon:
|
||||
// Icon(Icons.playlist_add),
|
||||
SizedBox(
|
||||
height: 16,
|
||||
width: 21,
|
||||
child:
|
||||
CustomPaint(
|
||||
painter:
|
||||
AddToPlaylistPainter(
|
||||
context
|
||||
.textTheme
|
||||
.bodyText1
|
||||
.color,
|
||||
context
|
||||
.textTheme
|
||||
.bodyText1
|
||||
.color,
|
||||
))),
|
||||
onPressed: () {}),
|
||||
);
|
||||
}),
|
||||
Material(
|
||||
color: Colors.transparent,
|
||||
child: IconButton(
|
||||
tooltip: 'Change layout',
|
||||
padding: EdgeInsets.zero,
|
||||
onPressed: () {
|
||||
if (_layout == Layout.three)
|
||||
setState(() {
|
||||
_layout = Layout.two;
|
||||
});
|
||||
else
|
||||
setState(() {
|
||||
_layout = Layout.three;
|
||||
});
|
||||
},
|
||||
icon: _layout == Layout.three
|
||||
? SizedBox(
|
||||
height: 10,
|
||||
width: 30,
|
||||
child: CustomPaint(
|
||||
painter: LayoutPainter(
|
||||
0,
|
||||
context.textTheme
|
||||
.bodyText1.color),
|
||||
),
|
||||
)
|
||||
: SizedBox(
|
||||
height: 10,
|
||||
width: 30,
|
||||
child: CustomPaint(
|
||||
painter: LayoutPainter(
|
||||
1,
|
||||
context.textTheme
|
||||
.bodyText1.color),
|
||||
),
|
||||
),
|
||||
)),
|
||||
],
|
||||
)),
|
||||
),
|
||||
EpisodeGrid(
|
||||
episodes: snapshot.data,
|
||||
layout: _layout,
|
||||
),
|
||||
SliverList(
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
(BuildContext context, int index) {
|
||||
return _loadMore
|
||||
? Container(
|
||||
height: 2,
|
||||
child: LinearProgressIndicator())
|
||||
: Center();
|
||||
},
|
||||
childCount: 1,
|
||||
),
|
||||
),
|
||||
]),
|
||||
)
|
||||
Spacer(),
|
||||
FutureBuilder<int>(
|
||||
future: _getUpdateCounts(_group),
|
||||
initialData: 0,
|
||||
builder: (context, snapshot) {
|
||||
return snapshot.data != 0
|
||||
? Material(
|
||||
color: Colors.transparent,
|
||||
child: IconButton(
|
||||
tooltip:
|
||||
'Add new episodes to playlist',
|
||||
icon:
|
||||
// Icon(Icons.playlist_add),
|
||||
SizedBox(
|
||||
height: 16,
|
||||
width: 21,
|
||||
child: CustomPaint(
|
||||
painter: AddToPlaylistPainter(
|
||||
context
|
||||
.textTheme
|
||||
.bodyText1
|
||||
.color,
|
||||
Colors
|
||||
.red))),
|
||||
onPressed: () async {
|
||||
await audio
|
||||
.addNewEpisode(
|
||||
_group);
|
||||
if (mounted)
|
||||
setState(() {});
|
||||
Fluttertoast
|
||||
.showToast(
|
||||
msg: _groupName ==
|
||||
'All'
|
||||
? '${snapshot.data} episode added to playlist'
|
||||
: '${snapshot.data} episode in $_groupName added to playlist',
|
||||
gravity:
|
||||
ToastGravity
|
||||
.BOTTOM,
|
||||
);
|
||||
}),
|
||||
)
|
||||
: Material(
|
||||
color: Colors.transparent,
|
||||
child: IconButton(
|
||||
tooltip:
|
||||
'Add new episodes to playlist',
|
||||
icon:
|
||||
// Icon(Icons.playlist_add),
|
||||
SizedBox(
|
||||
height: 16,
|
||||
width: 21,
|
||||
child:
|
||||
CustomPaint(
|
||||
painter:
|
||||
AddToPlaylistPainter(
|
||||
context
|
||||
.textTheme
|
||||
.bodyText1
|
||||
.color,
|
||||
context
|
||||
.textTheme
|
||||
.bodyText1
|
||||
.color,
|
||||
))),
|
||||
onPressed: () {}),
|
||||
);
|
||||
}),
|
||||
Material(
|
||||
color: Colors.transparent,
|
||||
child: IconButton(
|
||||
tooltip: 'Change layout',
|
||||
padding: EdgeInsets.zero,
|
||||
onPressed: () {
|
||||
if (_layout == Layout.three)
|
||||
setState(() {
|
||||
_layout = Layout.two;
|
||||
});
|
||||
else
|
||||
setState(() {
|
||||
_layout = Layout.three;
|
||||
});
|
||||
},
|
||||
icon: _layout == Layout.three
|
||||
? SizedBox(
|
||||
height: 10,
|
||||
width: 30,
|
||||
child: CustomPaint(
|
||||
painter: LayoutPainter(
|
||||
0,
|
||||
context
|
||||
.textTheme
|
||||
.bodyText1
|
||||
.color),
|
||||
),
|
||||
)
|
||||
: SizedBox(
|
||||
height: 10,
|
||||
width: 30,
|
||||
child: CustomPaint(
|
||||
painter: LayoutPainter(
|
||||
1,
|
||||
context
|
||||
.textTheme
|
||||
.bodyText1
|
||||
.color),
|
||||
),
|
||||
),
|
||||
)),
|
||||
],
|
||||
)),
|
||||
),
|
||||
EpisodeGrid(
|
||||
episodes: snapshot.data,
|
||||
layout: _layout,
|
||||
),
|
||||
SliverList(
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
(BuildContext context, int index) {
|
||||
return _loadMore
|
||||
? Container(
|
||||
height: 2,
|
||||
child: LinearProgressIndicator())
|
||||
: Center();
|
||||
},
|
||||
childCount: 1,
|
||||
),
|
||||
),
|
||||
]);
|
||||
},
|
||||
))
|
||||
: Center();
|
||||
},
|
||||
);
|
||||
@ -944,7 +960,7 @@ class _MyDownloadState extends State<_MyDownload>
|
||||
return episodes.length == 0
|
||||
? SliverToBoxAdapter(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(top:100),
|
||||
padding: EdgeInsets.only(top: 100),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
|
@ -1,24 +0,0 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
enum ImportState{start, import, parse, complete, stop, error}
|
||||
|
||||
class ImportOmpl extends ChangeNotifier{
|
||||
ImportState _importState = ImportState.stop;
|
||||
String _rssTitle;
|
||||
|
||||
String get rsstitle => _rssTitle;
|
||||
|
||||
set rssTitle(String title){
|
||||
_rssTitle = title;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
ImportState get importState => _importState;
|
||||
|
||||
set importState(ImportState state){
|
||||
if(_importState != state)
|
||||
{_importState = state;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
}
|
@ -36,6 +36,7 @@ class SubscribeWorker extends ChangeNotifier {
|
||||
SubscribeItem _subscribeItem;
|
||||
SubscribeItem _currentSubscribeItem = SubscribeItem('', '');
|
||||
bool _created = false;
|
||||
bool get created => _created;
|
||||
|
||||
setSubscribeItem(SubscribeItem item) async {
|
||||
_subscribeItem = item;
|
||||
@ -71,6 +72,7 @@ class SubscribeWorker extends ChangeNotifier {
|
||||
subIsolate = null;
|
||||
_currentSubscribeItem = SubscribeItem('', '');
|
||||
_created = false;
|
||||
notifyListeners();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -148,7 +148,7 @@ class EpisodeGrid extends StatelessWidget {
|
||||
: episodes[index].primaryColor.colorizeLight();
|
||||
return FadeTransition(
|
||||
opacity: Tween<double>(
|
||||
begin: 0,
|
||||
begin: index < 12 ? 0 : 1,
|
||||
end: 1,
|
||||
).animate(animation),
|
||||
child: Selector<AudioPlayerNotifier,
|
||||
|
Loading…
x
Reference in New Issue
Block a user