Fix Key Event Error in New Flutter Version
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.
Sorry for that i had forgotten to add the review
Make a review for this pull request
@naidu199 Please create this in pluto_grid_plus this repo is dead
Yeah ok sure
Please close this PR, to clean up thanks