From ba4ced4ea82847a88e8fa2c86f5f20a5343ef69a Mon Sep 17 00:00:00 2001 From: Songzex <2402265378@qq.com> Date: Wed, 25 Mar 2026 09:28:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=89=8D=E5=90=8E=E5=92=8C?= =?UTF-8?q?=E5=B7=A6=E5=8F=B3=E7=9A=84=E6=8C=AF=E5=8A=A8=E6=95=88=E6=9E=9C?= =?UTF-8?q?=E5=A0=B5=E5=A1=9E=E5=8F=91=E9=80=81=E8=BF=87=E7=A8=8B=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/widgets/left_joystick_area.dart | 8 +++++--- .../widgets/right_joystick_area.dart | 6 ++++-- pubspec.lock | 16 ++++++++-------- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/lib/features/remote_control/presentation/widgets/left_joystick_area.dart b/lib/features/remote_control/presentation/widgets/left_joystick_area.dart index 241f7e7d..b2469398 100644 --- a/lib/features/remote_control/presentation/widgets/left_joystick_area.dart +++ b/lib/features/remote_control/presentation/widgets/left_joystick_area.dart @@ -33,7 +33,9 @@ class LeftJoystickArea extends StatelessWidget { onValueChanged: (value) { // 对应 viewModel.updateOriginY(y) context.read().updateOriginY(value.y); - _triggerVibration(); + Future.delayed(const Duration(milliseconds: 50), () { + _triggerVibration(); + }); }, onPress: () { // 对应 VibrateOnce(current, 100) @@ -59,8 +61,8 @@ class LeftJoystickArea extends StatelessWidget { void _triggerVibration() { Vibration.hasVibrator().then((hasVibrator) { if (hasVibrator ?? false) { - Vibration.vibrate(duration: 100); - debugPrint('📳 [右摇杆] 震动执行 - 100ms'); + Vibration.vibrate(duration: 12); + debugPrint('📳 [右摇杆] 震动执行 - 10ms'); } else { debugPrint('⚠️ [右摇杆] 设备不支持震动'); } diff --git a/lib/features/remote_control/presentation/widgets/right_joystick_area.dart b/lib/features/remote_control/presentation/widgets/right_joystick_area.dart index e111c221..7710268a 100644 --- a/lib/features/remote_control/presentation/widgets/right_joystick_area.dart +++ b/lib/features/remote_control/presentation/widgets/right_joystick_area.dart @@ -34,7 +34,9 @@ class RightJoystickArea extends StatelessWidget { // 对应 viewModel.updateOriginX(x) /// context.read().updateOriginY(value.x); context.read().updateOriginX(value.x); - _triggerVibration(); + Future.delayed(const Duration(milliseconds: 50), () { + _triggerVibration(); + }); }, onPress: () { _triggerVibration(); @@ -60,7 +62,7 @@ class RightJoystickArea extends StatelessWidget { void _triggerVibration() { Vibration.hasVibrator().then((hasVibrator) { if (hasVibrator ?? false) { - Vibration.vibrate(duration: 100); + Vibration.vibrate(duration: 12); debugPrint('📳 [右摇杆] 震动执行 - 100ms'); } else { debugPrint('⚠️ [右摇杆] 设备不支持震动'); diff --git a/pubspec.lock b/pubspec.lock index 67f6c7d6..b951bed0 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -132,10 +132,10 @@ packages: dependency: transitive description: name: characters - sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b + sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 url: "https://pub.flutter-io.cn" source: hosted - version: "1.4.1" + version: "1.4.0" checked_yaml: dependency: transitive description: @@ -811,18 +811,18 @@ packages: dependency: transitive description: name: matcher - sha256: dc0b7dc7651697ea4ff3e69ef44b0407ea32c487a39fff6a4004fa585e901861 + sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 url: "https://pub.flutter-io.cn" source: hosted - version: "0.12.19" + version: "0.12.17" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b" + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec url: "https://pub.flutter-io.cn" source: hosted - version: "0.13.0" + version: "0.11.1" meta: dependency: transitive description: @@ -1280,10 +1280,10 @@ packages: dependency: transitive description: name: test_api - sha256: "8161c84903fd860b26bfdefb7963b3f0b68fee7adea0f59ef805ecca346f0c7a" + sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55 url: "https://pub.flutter-io.cn" source: hosted - version: "0.7.10" + version: "0.7.7" time: dependency: transitive description: