Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion jive-flutter/lib/services/deep_link_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ class DeepLinkService {

// 监听应用运行时的链接
_linkSubscription = uni_links.linkStream.listen((link) {
_handleDeepLink(link);
final v = link ?? '';
if (v.isEmpty) return;
_handleDeepLink(v);
Comment on lines +32 to +34

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This logic for handling a nullable link can be simplified. The _handleDeepLink function and its subsequent call to _parseDeepLink can gracefully handle an empty string, so checking for isEmpty is redundant. A simple null check is cleaner and sufficient.

Suggested change
final v = link ?? '';
if (v.isEmpty) return;
_handleDeepLink(v);
if (link != null) _handleDeepLink(link);

}, onError: (err) {
debugPrint('Link stream error: $err');
});
Expand Down
2 changes: 1 addition & 1 deletion jive-flutter/lib/services/email_notification_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ class EmailNotificationService extends ChangeNotifier {
/// 发送单个邮件
Future<void> _sendEmail(EmailMessage email) async {
final message = Message()
..from = const Address('noreply@jivemoney.com', 'Jive Money')
..from = const _Address('noreply@jivemoney.com', 'Jive Money')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The class _Address is not defined in this file, which will cause a compilation error. Based on the PR description, it seems a local stub was intended. Please add the _Address stub class to this file.

For example, you could add a stub similar to this:

class _Address {
  final String address;
  final String? name;
  const _Address(this.address, [this.name]);
}

..recipients.add(email.to)
..subject = email.subject
..html = email.html;
Expand Down
9 changes: 5 additions & 4 deletions jive-flutter/lib/services/family_settings_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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;

Expand Down
12 changes: 6 additions & 6 deletions jive-flutter/lib/widgets/color_picker_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ class _ColorPickerDialogState extends State<ColorPickerDialog> {
),
),

SizedBox(height: 16),
const SizedBox(height: 16),

// 十六进制输入
TextField(
controller: _hexController,
decoration: InputDecoration(
labelText: '十六进制颜色值',
hintText: 'FFFFFF',
border: OutlineInputBorder(),
border: const OutlineInputBorder(),
prefixText: '#',
),
maxLength: 6,
Expand All @@ -91,22 +91,22 @@ class _ColorPickerDialogState extends State<ColorPickerDialog> {
onChanged: _onHexChanged,
),

SizedBox(height: 16),
const SizedBox(height: 16),

// RGB滑块
_buildRGBSliders(),

SizedBox(height: 16),
const SizedBox(height: 16),

// 预设颜色
Text(
const Text(
'预设颜色',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
SizedBox(height: 8),
const SizedBox(height: 8),
_buildPresetColors(),
],
),
Expand Down
3 changes: 2 additions & 1 deletion jive-flutter/lib/widgets/common/right_click_copy.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>(
final result = // ignore: use_build_context_synchronously (pre-captured messenger, no context use after await)
await showMenu<String>(
context: context,
position: RelativeRect.fromRect(
Rect.fromLTWH(position.dx, position.dy, 0, 0),
Expand Down
2 changes: 1 addition & 1 deletion jive-flutter/lib/widgets/states/loading_indicator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down