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