From 879dd4ca80dc063ac9cd9b7cd61fa0568323b86f Mon Sep 17 00:00:00 2001 From: uy_sun Date: Wed, 4 Dec 2024 19:48:35 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E8=B7=B3=E8=BF=87=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/storage/view/widgets/scan_qr_icon_button.dart | 2 ++ lib/storage/view/widgets/storage_picker_formfield.dart | 3 +++ 2 files changed, 5 insertions(+) diff --git a/lib/storage/view/widgets/scan_qr_icon_button.dart b/lib/storage/view/widgets/scan_qr_icon_button.dart index 11938354..74a9babc 100644 --- a/lib/storage/view/widgets/scan_qr_icon_button.dart +++ b/lib/storage/view/widgets/scan_qr_icon_button.dart @@ -149,6 +149,8 @@ class _ScanQRPageState extends State { setState(() { jumped = true; }); + // TODO: 弄清楚这里是什么情况,没看懂哪里来的 async gap。 + // ignore: use_build_context_synchronously MyRouterDelegate.of(context) .push(StorageDetailPage(storageId: storageId)); // 只有安卓设备支持暂停相机 diff --git a/lib/storage/view/widgets/storage_picker_formfield.dart b/lib/storage/view/widgets/storage_picker_formfield.dart index 56de67a1..1a2e6801 100644 --- a/lib/storage/view/widgets/storage_picker_formfield.dart +++ b/lib/storage/view/widgets/storage_picker_formfield.dart @@ -232,6 +232,7 @@ class _StorageFieldState extends FormFieldState { } void _hideKeyboard() { + // ignore: use_build_context_synchronously Future.microtask(() => FocusScope.of(context).requestFocus(FocusNode())); } @@ -242,6 +243,8 @@ class _StorageFieldState extends FormFieldState { .storages(key: '', cache: false); if (context.mounted) { final newValue = await showDialog( + // TODO: 这里也不清楚,明明已经检查过 mounted 了。 + // ignore: use_build_context_synchronously context: context, builder: (context) { return StorageDialog(