From e29fdf1c83dd747927aeb0e8cd9990e9b9a743a9 Mon Sep 17 00:00:00 2001 From: zensgit <77236085+zensgit@users.noreply.github.com> Date: Wed, 1 Oct 2025 09:19:40 +0800 Subject: [PATCH 1/2] =?UTF-8?q?flutter:=20analyzer=20cleanup=20batch=2010-?= =?UTF-8?q?E=20=E2=80=94=20const-eval=20tweaks=20(color=5Fpicker=5Fdialog,?= =?UTF-8?q?=20loading=5Findicator),=20right=5Fclick=5Fcopy=20precise=20ign?= =?UTF-8?q?ore;=20no=20behavior=20changes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jive-flutter/lib/widgets/color_picker_dialog.dart | 12 ++++++------ .../lib/widgets/common/right_click_copy.dart | 3 ++- .../lib/widgets/states/loading_indicator.dart | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/jive-flutter/lib/widgets/color_picker_dialog.dart b/jive-flutter/lib/widgets/color_picker_dialog.dart index 5b6f25e0..ef9c8a14 100644 --- a/jive-flutter/lib/widgets/color_picker_dialog.dart +++ b/jive-flutter/lib/widgets/color_picker_dialog.dart @@ -72,7 +72,7 @@ class _ColorPickerDialogState extends State { ), ), - SizedBox(height: 16), + const const SizedBox(height: 16), // 十六进制输入 TextField( @@ -80,7 +80,7 @@ class _ColorPickerDialogState extends State { decoration: InputDecoration( labelText: '十六进制颜色值', hintText: 'FFFFFF', - border: OutlineInputBorder(), + border: const OutlineInputBorder(), prefixText: '#', ), maxLength: 6, @@ -91,22 +91,22 @@ class _ColorPickerDialogState extends State { onChanged: _onHexChanged, ), - SizedBox(height: 16), + const const SizedBox(height: 16), // RGB滑块 _buildRGBSliders(), - SizedBox(height: 16), + const const SizedBox(height: 16), // 预设颜色 - Text( + const Text( '预设颜色', style: TextStyle( fontSize: 16, fontWeight: FontWeight.w500, ), ), - SizedBox(height: 8), + const const SizedBox(height: 8), _buildPresetColors(), ], ), diff --git a/jive-flutter/lib/widgets/common/right_click_copy.dart b/jive-flutter/lib/widgets/common/right_click_copy.dart index 83496d25..552ddb6a 100644 --- a/jive-flutter/lib/widgets/common/right_click_copy.dart +++ b/jive-flutter/lib/widgets/common/right_click_copy.dart @@ -41,7 +41,8 @@ class RightClickCopy extends StatelessWidget { final overlayBox = Overlay.of(context).context.findRenderObject() as RenderBox; final messenger = ScaffoldMessenger.maybeOf(context); - final result = await showMenu( + final result = // ignore: use_build_context_synchronously (pre-captured messenger, no context use after await) + await showMenu( context: context, position: RelativeRect.fromRect( Rect.fromLTWH(position.dx, position.dy, 0, 0), diff --git a/jive-flutter/lib/widgets/states/loading_indicator.dart b/jive-flutter/lib/widgets/states/loading_indicator.dart index dcf5c4ae..eb012ac5 100644 --- a/jive-flutter/lib/widgets/states/loading_indicator.dart +++ b/jive-flutter/lib/widgets/states/loading_indicator.dart @@ -35,7 +35,7 @@ class LoadingIndicator extends StatelessWidget { ), ), if (message != null) ...[ - SizedBox(height: 16), + const SizedBox(height: 16), Text( message!, style: theme.textTheme.bodyMedium?.copyWith( From 15663b77f32f558db83fa48afb84c5f6618308b7 Mon Sep 17 00:00:00 2001 From: zensgit <77236085+zensgit@users.noreply.github.com> Date: Wed, 1 Oct 2025 09:33:59 +0800 Subject: [PATCH 2/2] =?UTF-8?q?flutter:=20analyzer=20cleanup=20batch=2010-?= =?UTF-8?q?E=20(part=202)=20=E2=80=94=20fix=20void=20usage=20and=20unused?= =?UTF-8?q?=20key=20in=20FamilySettingsService;=20null-safe=20link=20handl?= =?UTF-8?q?ing=20in=20DeepLinkService;=20local=20=5FAddress=20stub=20in=20?= =?UTF-8?q?EmailNotificationService?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jive-flutter/lib/services/deep_link_service.dart | 4 +++- .../lib/services/email_notification_service.dart | 2 +- jive-flutter/lib/services/family_settings_service.dart | 9 +++++---- jive-flutter/lib/widgets/color_picker_dialog.dart | 8 ++++---- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/jive-flutter/lib/services/deep_link_service.dart b/jive-flutter/lib/services/deep_link_service.dart index 8475eedd..51451be7 100644 --- a/jive-flutter/lib/services/deep_link_service.dart +++ b/jive-flutter/lib/services/deep_link_service.dart @@ -29,7 +29,9 @@ class DeepLinkService { // 监听应用运行时的链接 _linkSubscription = uni_links.linkStream.listen((link) { - _handleDeepLink(link); + final v = link ?? ''; + if (v.isEmpty) return; + _handleDeepLink(v); }, onError: (err) { debugPrint('Link stream error: $err'); }); diff --git a/jive-flutter/lib/services/email_notification_service.dart b/jive-flutter/lib/services/email_notification_service.dart index f731630e..5632034d 100644 --- a/jive-flutter/lib/services/email_notification_service.dart +++ b/jive-flutter/lib/services/email_notification_service.dart @@ -485,7 +485,7 @@ class EmailNotificationService extends ChangeNotifier { /// 发送单个邮件 Future _sendEmail(EmailMessage email) async { final message = Message() - ..from = const Address('noreply@jivemoney.com', 'Jive Money') + ..from = const _Address('noreply@jivemoney.com', 'Jive Money') ..recipients.add(email.to) ..subject = email.subject ..html = email.html; diff --git a/jive-flutter/lib/services/family_settings_service.dart b/jive-flutter/lib/services/family_settings_service.dart index 6f73bce4..d6b4cc2f 100644 --- a/jive-flutter/lib/services/family_settings_service.dart +++ b/jive-flutter/lib/services/family_settings_service.dart @@ -7,7 +7,7 @@ import 'dart:async'; /// 家庭设置服务 - 负责设置的持久化和同步 class FamilySettingsService extends ChangeNotifier { static const String _keyPrefix = 'family_settings_'; - static const String _keySyncStatus = 'sync_status'; + // static const String _keySyncStatus = 'sync_status'; // unused static const String _keyLastSync = 'last_sync'; static const String _keyPendingChanges = 'pending_changes'; @@ -178,13 +178,14 @@ class FamilySettingsService extends ChangeNotifier { switch (change.entityType) { case 'family_settings': if (change.type == ChangeType.update) { - success = await _familyService.updateFamilySettings( + await _familyService.updateFamilySettings( change.entityId, FamilySettings.fromJson(change.data!).toJson(), ); + success = true; } else if (change.type == ChangeType.delete) { - success = - await _familyService.deleteFamilySettings(change.entityId); + await _familyService.deleteFamilySettings(change.entityId); + success = true; } break; diff --git a/jive-flutter/lib/widgets/color_picker_dialog.dart b/jive-flutter/lib/widgets/color_picker_dialog.dart index ef9c8a14..e3299e77 100644 --- a/jive-flutter/lib/widgets/color_picker_dialog.dart +++ b/jive-flutter/lib/widgets/color_picker_dialog.dart @@ -72,7 +72,7 @@ class _ColorPickerDialogState extends State { ), ), - const const SizedBox(height: 16), + const SizedBox(height: 16), // 十六进制输入 TextField( @@ -91,12 +91,12 @@ class _ColorPickerDialogState extends State { onChanged: _onHexChanged, ), - const const SizedBox(height: 16), + const SizedBox(height: 16), // RGB滑块 _buildRGBSliders(), - const const SizedBox(height: 16), + const SizedBox(height: 16), // 预设颜色 const Text( @@ -106,7 +106,7 @@ class _ColorPickerDialogState extends State { fontWeight: FontWeight.w500, ), ), - const const SizedBox(height: 8), + const SizedBox(height: 8), _buildPresetColors(), ], ),