Closed naidu199 closed 3 weeks ago
i had solved this error created PR anyone accept it This pull request addresses an issue with key event handling in the new version of Flutter. The original code caused a type error due to changes in how key events and states are managed. The updated code snippet explicitly casts " keyEvent.event " as "KeyEvent " and "state" as "HardwareKeyboard", resolving the error.
Changes Made
File Location:
lib/src/manager/shortcut/pluto_grid_shortcut.dart (line 33)
Original Code:
if (action.key.accepts(keyEvent.event, state)) {
action.value.execute(keyEvent: keyEvent, stateManager: stateManager);
return true;
}
Updated Code:
if (action.key.accepts(keyEvent.event as KeyEvent, state as HardwareKeyboard)) {
action.value.execute(keyEvent: keyEvent, stateManager: stateManager);
return true;
}
Reason for Changes In the new version of Flutter, there were type changes that caused the original code to throw an error. By explicitly casting the types, the code is now compatible with the updated Flutter API.
The updated code has been tested and verified to work correctly without causing the previous type error.
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.
Getting this error while running the applictaion
Flutter version : Flutter 3.22.2 • channel stable • https://github.com/flutter/flutter.git Framework • revision 761747bfc5 (9 weeks ago) • 2024-06-05 22:15:13 +0200 Engine • revision edd8546116 Tools • Dart 3.4.3 • DevTools 2.34.3
pluto grid version : pluto_grid: ^7.0.2