mirror of
https://github.com/simon-ding/polaris.git
synced 2026-06-07 02:27:40 +08:00
fix: return null
This commit is contained in:
@@ -131,7 +131,7 @@ class APIs {
|
||||
if (sp.code != 0) {
|
||||
throw sp.message;
|
||||
}
|
||||
return sp.data as List<String>;
|
||||
return sp.data==null? []:sp.data as List<String>;
|
||||
}
|
||||
|
||||
static Future<List<String>> downloadAllMovies() async {
|
||||
@@ -142,7 +142,7 @@ class APIs {
|
||||
if (sp.code != 0) {
|
||||
throw sp.message;
|
||||
}
|
||||
return sp.data as List<String>;
|
||||
return sp.data==null? []:sp.data as List<String>;
|
||||
}
|
||||
|
||||
static Future<String> parseTvName(String s) async {
|
||||
|
||||
@@ -123,11 +123,15 @@ class WelcomePageState extends ConsumerState<WelcomePage> {
|
||||
onPressed: () async {
|
||||
if (uri == WelcomePage.routeMoivie) {
|
||||
await APIs.downloadAllMovies().then((v) {
|
||||
showSnakeBar("开始下载电影:$v");
|
||||
if (v.isNotEmpty) {
|
||||
showSnakeBar("开始下载电影:$v");
|
||||
}
|
||||
});
|
||||
} else {
|
||||
await APIs.downloadAllTv().then((v) {
|
||||
showSnakeBar("开始下载剧集:$v");
|
||||
if (v.isNotEmpty) {
|
||||
showSnakeBar("开始下载剧集:$v");
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user