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