diff --git a/.github/workflows/flutter-drive.yml b/.github/workflows/flutter-drive.yml index 4223a4c03..d2e11c7fd 100644 --- a/.github/workflows/flutter-drive.yml +++ b/.github/workflows/flutter-drive.yml @@ -53,7 +53,7 @@ jobs: # https://github.com/marketplace/actions/flutter-action - uses: subosito/flutter-action@v2 with: - flutter-version: '3.13.6' + flutter-version: '3.16.0' channel: 'stable' # or: 'dev' or 'beta' architecture: x64 - run: "flutter clean" @@ -78,7 +78,7 @@ jobs: java-version: '11' - uses: subosito/flutter-action@v2 with: - flutter-version: '3.13.6' + flutter-version: '3.16.0' channel: 'stable' # or: 'dev' or 'beta' architecture: x64 - name: "Run Flutter Driver tests" @@ -104,7 +104,7 @@ jobs: # https://github.com/marketplace/actions/flutter-action - uses: subosito/flutter-action@v2 with: - flutter-version: '3.13.6' + flutter-version: '3.16.0' channel: 'stable' architecture: x64 - run: "flutter pub get" diff --git a/.github/workflows/flutter-web-deploy.yml b/.github/workflows/flutter-web-deploy.yml index 7c00b3ee8..5829863eb 100644 --- a/.github/workflows/flutter-web-deploy.yml +++ b/.github/workflows/flutter-web-deploy.yml @@ -5,7 +5,7 @@ name: flutter_deer web deploy on: push: paths: - - 'pubspec1.yaml' + - 'pubspec.yaml' jobs: web_build_and_deploy: @@ -14,7 +14,7 @@ jobs: - uses: actions/checkout@v2.3.1 - uses: subosito/flutter-action@v2 with: - flutter-version: '3.13.6' + flutter-version: '3.16.0' channel: 'stable' architecture: x64 - name: "Web Build 🔧" diff --git a/README-EN.md b/README-EN.md index 0b1db4b97..fc73223ab 100644 --- a/README-EN.md +++ b/README-EN.md @@ -66,9 +66,9 @@ For web experience, please visit: https://simplezhli.github.io/flutter_deer/ [![Build Status](https://github.com/simplezhli/flutter_deer/workflows/flutter_deer%20driver/badge.svg?branch=master)](https://github.com/simplezhli/flutter_deer/actions?query=workflow%3A%22flutter_deer+driver%22+branch%3Amaster) - 1. Flutter version 3.13.6 + 1. Flutter version 3.16.0 - 2. Dart version 3.1.3 + 2. Dart version 3.2.0 ## Precautions to be taken. diff --git a/README.md b/README.md index b5606ef2b..6811e1e69 100644 --- a/README.md +++ b/README.md @@ -66,9 +66,9 @@ Web体验地址:https://simplezhli.github.io/flutter_deer/ [![Build Status](https://github.com/simplezhli/flutter_deer/workflows/flutter_deer%20driver/badge.svg?branch=master)](https://github.com/simplezhli/flutter_deer/actions?query=workflow%3A%22flutter_deer+driver%22+branch%3Amaster) - 1. Flutter version 3.13.6 + 1. Flutter version 3.16.0 - 2. Dart version 3.1.3 + 2. Dart version 3.2.0 ## 注意事项 diff --git a/ios/Podfile b/ios/Podfile index db9a5fd45..00d2e9470 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -2,7 +2,7 @@ platform :ios, '11.0' # source 'https://github.com/CocoaPods/Specs.git' - +source 'https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/lib/account/page/withdrawal_page.dart b/lib/account/page/withdrawal_page.dart index d576c834b..f9fdbb1b3 100644 --- a/lib/account/page/withdrawal_page.dart +++ b/lib/account/page/withdrawal_page.dart @@ -55,11 +55,10 @@ class _WithdrawalPageState extends State { @override Widget build(BuildContext context) { - return WillPopScope( - onWillPop: () { + return PopScope( + onPopInvoked: (_) { /// 拦截返回,关闭键盘,否则会造成上一页面短暂的组件溢出 FocusManager.instance.primaryFocus?.unfocus(); - return Future.value(true); }, child: Scaffold( appBar: const MyAppBar( diff --git a/lib/main.dart b/lib/main.dart index ef134bbeb..71208b709 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -180,7 +180,7 @@ class MyApp extends StatelessWidget { /// 保证文字大小不受手机系统设置影响 https://www.kikt.top/posts/flutter/layout/dynamic-text/ return MediaQuery( - data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0), + data: MediaQuery.of(context).copyWith(textScaler: TextScaler.noScaling), child: child!, ); }, diff --git a/lib/mvp/base_page.dart b/lib/mvp/base_page.dart index 20b95f76c..3cd10ef2f 100644 --- a/lib/mvp/base_page.dart +++ b/lib/mvp/base_page.dart @@ -38,11 +38,10 @@ mixin BasePageMixin on State< barrierDismissible: false, barrierColor: const Color(0x00FFFFFF), // 默认dialog背景色为半透明黑色,这里修改为透明(1.20添加属性) builder:(_) { - return WillPopScope( - onWillPop: () async { + return PopScope( + onPopInvoked: (_) { // 拦截到返回键,证明dialog被手动关闭 _isShowDialog = false; - return Future.value(true); }, child: buildProgress(), ); diff --git a/lib/setting/widgets/update_dialog.dart b/lib/setting/widgets/update_dialog.dart index d4eddbda5..f33bc7264 100644 --- a/lib/setting/widgets/update_dialog.dart +++ b/lib/setting/widgets/update_dialog.dart @@ -39,11 +39,8 @@ class _UpdateDialogState extends State { @override Widget build(BuildContext context) { final Color primaryColor = Theme.of(context).primaryColor; - return WillPopScope( - onWillPop: () async { - /// 使用false禁止返回键返回,达到强制升级目的 - return true; - }, + return PopScope( + canPop: false, /// 使用false禁止返回键返回,达到强制升级目的 child: Scaffold( resizeToAvoidBottomInset: false, backgroundColor: Colors.transparent, diff --git a/lib/widgets/bezier_chart/my_single_child_scroll_view.dart b/lib/widgets/bezier_chart/my_single_child_scroll_view.dart index fa55a8612..2a41cc6ae 100644 --- a/lib/widgets/bezier_chart/my_single_child_scroll_view.dart +++ b/lib/widgets/bezier_chart/my_single_child_scroll_view.dart @@ -363,7 +363,8 @@ class _RenderSingleChildViewport extends RenderBox @override RevealedOffset getOffsetToReveal(RenderObject target, double alignment, - {Rect? rect}) { + {Rect? rect, Axis? axis,}) { + axis = this.axis; rect ??= target.paintBounds; if (target is! RenderBox) return RevealedOffset(offset: offset.pixels, rect: rect); diff --git a/lib/widgets/double_tap_back_exit_app.dart b/lib/widgets/double_tap_back_exit_app.dart index 5adfaf860..d24bfe807 100644 --- a/lib/widgets/double_tap_back_exit_app.dart +++ b/lib/widgets/double_tap_back_exit_app.dart @@ -25,21 +25,19 @@ class _DoubleTapBackExitAppState extends State { @override Widget build(BuildContext context) { - return WillPopScope( - onWillPop: _isExit, + return PopScope( + canPop: _lastTime == null || DateTime.now().difference(_lastTime!) > widget.duration, + onPopInvoked: (didPop) { + if (!didPop) { + Toast.cancelToast(); + /// 不推荐使用 `dart:io` 的 exit(0) + SystemNavigator.pop(); + } else { + _lastTime = DateTime.now(); + Toast.show('再次点击退出应用'); + } + }, child: widget.child, ); } - - Future _isExit() async { - if (_lastTime == null || DateTime.now().difference(_lastTime!) > widget.duration) { - _lastTime = DateTime.now(); - Toast.show('再次点击退出应用'); - return Future.value(false); - } - Toast.cancelToast(); - /// 不推荐使用 `dart:io` 的 exit(0) - await SystemNavigator.pop(); - return Future.value(true); - } }