feat(flutter): 增加关键操作震动反馈
This commit is contained in:
1 parent
e609e3ad8d
commit
8a481d5c62
20 files changed
+308
-72
No files matched your search
@@ -13,6 +13,7 @@ import '../../core/data/services/auth_controller.dart';
|
||||
import '../../core/data/services/watch_records_controller.dart';
|
||||
import '../../core/formatting/error_text.dart';
|
||||
import '../../core/formatting/localized_date_time.dart';
|
||||
import '../../core/platform/haptics.dart';
|
||||
import '../../core/theme/app_colors.dart';
|
||||
import '../../core/theme/app_theme.dart';
|
||||
import '../../core/widgets/auth_gate.dart';
|
||||
@@ -141,6 +142,7 @@ class _WatchRecordsBodyState extends State<_WatchRecordsBody> {
|
||||
}
|
||||
|
||||
Future<void> _remove(String dramaId) async {
|
||||
unawaited(context.read<Haptics>().mediumImpact());
|
||||
final ok = await controller.remove(dramaId);
|
||||
if (!ok && mounted) _showFailure('recordDeleteFailed');
|
||||
}
|
||||
@@ -164,7 +166,8 @@ class _WatchRecordsBodyState extends State<_WatchRecordsBody> {
|
||||
],
|
||||
),
|
||||
);
|
||||
if (confirmed != true) return;
|
||||
if (confirmed != true || !mounted) return;
|
||||
unawaited(context.read<Haptics>().mediumImpact());
|
||||
final ok = await controller.clear();
|
||||
if (!ok && mounted) _showFailure('recordClearFailed');
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user