mirror of
https://github.com/simon-ding/polaris.git
synced 2026-03-07 10:00:46 +08:00
feat: show snakebar
This commit is contained in:
@@ -82,7 +82,7 @@ class SeriesDetailData
|
||||
ref.invalidateSelf();
|
||||
}
|
||||
|
||||
Future<void> downloadall() async {
|
||||
Future<dynamic> downloadall() async {
|
||||
final dio = APIs.getDio();
|
||||
var resp = await dio.get(APIs.downloadAllUrl + id!);
|
||||
var sp = ServerResponse.fromJson(resp.data);
|
||||
@@ -90,6 +90,7 @@ class SeriesDetailData
|
||||
throw sp.message;
|
||||
}
|
||||
ref.invalidateSelf();
|
||||
return sp.data;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -308,7 +308,9 @@ class _DetailCardState extends ConsumerState<DetailCard> {
|
||||
onPressed: () async{
|
||||
await ref
|
||||
.read(mediaDetailsProvider(widget.details.id.toString()).notifier)
|
||||
.downloadall();
|
||||
.downloadall().then((list) => {
|
||||
showSnakeBar("开始下载:$list")
|
||||
});
|
||||
},
|
||||
icon: Icons.download_rounded);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user