doonfrs / pluto_grid_plus

PlutoGrid is a dataGrid for flutter that can be controlled by the keyboard on desktop and web. Of course, it works well on Android and IOS.
https://pluto.weblaze.dev
MIT License
18 stars 20 forks source link

Fixes #6 Migrate RawKeyboardEvent and related implications according … #9

Closed aymswick closed 6 months ago

aymswick commented 6 months ago

…to Flutter recommendations described here: https://github.com/flutter/flutter/issues/136419

I swapped out the Raw version for the recommended Hardware version, and updated onKey to onKeyEvent in our keyboard listeners' FocusNodes as instructed by the migration guide: https://docs.flutter.dev/release/breaking-changes/key-event-migration . I believe merging this PR will get everyone on Flutter 3.19 compiling again without breaking existing functionality, but welcome further examination and manual testing.

I believe this change has caused 3 tests to fail in the pluto_key_manager_event_test.dart file, and have included a comment there to reflect what I believe to be the cause and best course of action for now. I have tested the 3 failing test cases manually (irl with a bluetooth keyboard on macOS and Chrome) and everything behaves as expected. I will paste the comment here as well:

While key combos still work in the real world, these 3 tests are failing due to what I suspect is an incomplete deprecation/migration from focusNode onKey to onKeyEvent. Flutter 3.19 does not trigger our event for sendKeyUpEvent only, and I prefer not to switch these tests to sendKeyDownEvent as that may cause unexpected behavior such as pasting multiple times due to repeating key presses. It might also be fine.

Additionally, I have reached out on the relevant Flutter issue (first link in this comment) to provide more clarity on if this test is failing due to an incomplete Flutter migration.

doonfrs commented 6 months ago

Thank you @aymswick for your great effort I will merge it first to allow the build then I will check the failed tests.