diff --git a/lib/services/download_file.dart b/lib/services/download_file.dart index d85c6c0..3f15dd4 100644 --- a/lib/services/download_file.dart +++ b/lib/services/download_file.dart @@ -82,9 +82,8 @@ Future downloadFile( throw err; }); - Future.delayed(const Duration(seconds: 5), () { - mirrorStatus(true); - }); + mirrorStatus(true); + cancelDownlaod(cancelToken); } catch (e) { onDownlaodFailed(); diff --git a/lib/ui/book_info_page.dart b/lib/ui/book_info_page.dart index ec0ea36..8d0e5fb 100644 --- a/lib/ui/book_info_page.dart +++ b/lib/ui/book_info_page.dart @@ -53,9 +53,7 @@ class BookInfoPage extends ConsumerWidget { var errJson = jsonDecode(err.toString()); if (SchedulerBinding.instance.schedulerPhase == SchedulerPhase.persistentCallbacks) { - SchedulerBinding.instance.addPostFrameCallback((_) async { - await Future.delayed(const Duration(seconds: 2)); - // ignore: use_build_context_synchronously + SchedulerBinding.instance.addPostFrameCallback((_) { Navigator.push(context, MaterialPageRoute(builder: (BuildContext context) { return Webview(url: errJson["url"]); diff --git a/pubspec.yaml b/pubspec.yaml index 5363565..8cc8e99 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 1.0.2+1 +version: 1.0.3+1 environment: sdk: '>=3.0.5 <4.0.0' @@ -47,7 +47,6 @@ dependencies: path_provider: ^2.0.15 permission_handler: ^10.4.3 open_file: ^3.3.2 - # flutter_inappwebview: ^5.8.0 http: ^1.1.0 webview_flutter: ^4.4.1 webview_cookie_manager: ^2.0.6