diff --git a/lib/utils/app_scheme.dart b/lib/utils/app_scheme.dart index b90201abb..d256e5e10 100644 --- a/lib/utils/app_scheme.dart +++ b/lib/utils/app_scheme.dart @@ -229,7 +229,6 @@ class PiliScheme { // 投稿跳转 static Future videoPush(int? aidVal, String? bvidVal) async { - SmartDialog.showLoading(msg: '获取中...'); try { int? aid = aidVal; String? bvid = bvidVal; @@ -239,17 +238,17 @@ class PiliScheme { if (bvidVal == null) { bvid = IdUtils.av2bv(aidVal!); } + SmartDialog.showLoading(msg: '获取中...'); final int cid = await SearchHttp.ab2c(bvid: bvidVal, aid: aidVal); + SmartDialog.dismiss(); final String heroTag = Utils.makeHeroTag(aid); - SmartDialog.dismiss().then( - // ignore: always_specify_types - (e) => Get.toNamed('/video?bvid=$bvid&cid=$cid', - arguments: { - 'pic': null, - 'heroTag': heroTag, - }), - ); + Get.toNamed('/video?bvid=$bvid&cid=$cid', + arguments: { + 'pic': null, + 'heroTag': heroTag, + }); } catch (e) { + SmartDialog.dismiss(); SmartDialog.showToast('video获取失败: $e'); } }