I have a task to fix some old flutter app for AndroidTV and and update it to newest version of Flutter In my old source, I'm using:
return Shortcuts(
shortcuts: <LogicalKeySet, Intent>{
LogicalKeySet(LogicalKeyboardKey.select): const ActivateIntent(),
},
So every time I press "select", it gives me this error:
E/flutter ( 8412): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: 'package:flutter/src/services/hardware_keyboard.dart': Failed assertion: line 437 pos 16: '_pressedKeys[event.physicalKey] == event.logicalKey': A KeyUpEvent is dispatched, but the state shows that the physical key is pressed on a different logical key. If this occurs in real application, please report this bug to Flutter. If this occurs in unit tests, please ensure that simulated events follow Flutter's event model as documented in `HardwareKeyboard`. This was the event: KeyUpEvent#f2d96(physicalKey: PhysicalKeyboardKey#f5c25(usbHidUsage: "0x000700e4", debugName: "Control Right"), logicalKey: LogicalKeyboardKey#d24f3(keyId: "0x200000101", keyLabel: "Control Right", debugName: "Control Right"), character: null, timeStamp: 0:00:05.159820, synthesized) and the recorded logical key LogicalKeyboardKey#4999d(keyId: "0x10000050c", keyLabel: "Select", debugName: "Select")
E/flutter ( 8412): #0 _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:51:61)
E/flutter ( 8412): #1 _AssertionError._throwNew (dart:core-patch/errors_patch.dart:40:5)
E/flutter ( 8412): #2 HardwareKeyboard._assertEventIsRegular.<anonymous closure> (package:flutter/src/services/hardware_keyboard.dart:437:16)
E/flutter ( 8412): #3 HardwareKeyboard._assertEventIsRegular (package:flutter/src/services/hardware_keyboard.dart:445:6)
E/flutter ( 8412): #4 HardwareKeyboard.handleKeyEvent (package:flutter/src/services/hardware_keyboard.dart:537:5)
E/flutter ( 8412): #5 KeyEventManager.handleKeyData (package:flutter/src/services/hardware_keyboard.dart:883:29)
E/flutter ( 8412): #6 PlatformDispatcher._keyDataListener.<anonymous closure>.<anonymous closure> (dart:ui/platform_dispatcher.dart:452:41)
E/flutter ( 8412): #7 _invoke1 (dart:ui/hooks.dart:158:13)
E/flutter ( 8412): #8 PlatformDispatcher._keyDataListener.<anonymous closure> (dart:ui/platform_dispatcher.dart:450:7)
E/flutter ( 8412): #9 _invoke2 (dart:ui/hooks.dart:174:13)
E/flutter ( 8412): #10 _ChannelCallbackRecord.invoke (dart:ui/channel_buffers.dart:40:5)
E/flutter ( 8412): #11 _Channel.push (dart:ui/channel_buffers.dart:130:31)
E/flutter ( 8412): #12 ChannelBuffers.push (dart:ui/channel_buffers.dart:326:17)
E/flutter ( 8412): #13 PlatformDispatcher._dispatchPlatformMessage (dart:ui/platform_dispatcher.dart:686:22)
E/flutter ( 8412): #14 _dispatchPlatformMessage (dart:ui/hooks.dart:86:31)
E/flutter ( 8412):
while other D-pad buttons are working normally.
Please give me some advice on how to solve this issue!