修复前后和左右的振动效果堵塞发送过程问题
This commit is contained in:
@@ -33,7 +33,9 @@ class LeftJoystickArea extends StatelessWidget {
|
||||
onValueChanged: (value) {
|
||||
// 对应 viewModel.updateOriginY(y)
|
||||
context.read<RemoteControlCubit>().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('⚠️ [右摇杆] 设备不支持震动');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user