Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Build Error 'RawKeyEvent' can't be assigned to the parameter type 'KeyEvent' #6

Closed
AndreLuizNogueira opened this issue Feb 6, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@AndreLuizNogueira
Copy link

I created a new blank application to test plutogrid, imported it, copied the code from the readme page but I can't build it, I also tried the code from the example page but the same error occurs.
I've already tried flutter clean, older version of plutogrid, restarted vscode, tried running on edge, chrome and windows.
I even downloaded the code and tried running the example application

POSSIBLE SOLUTION
I Opened the pluto grid code and it had only 1 error on pluto_grid_shortcut.dart at line 33, and the quickfix worked for me

it changed:

if (action.key.accepts(keyEvent.event, state))

to

if (action.key.accepts(keyEvent.event as KeyEvent, state as HardwareKeyboard))

I don't know if that is the correct fix, but can you check it out ?

Steps to reproduce the bug

Create new Project and import sample code from readme

Expected results

build

Actual results

Launching lib\main.dart on Windows in debug mode...
/C:/Users/.../pluto_grid_plus-8.2.0/lib/src/manager/shortcut/pluto_grid_shortcut.dart(33,39): error GC2F972A8: The argument type 'RawKeyEvent' can't be assigned to the parameter type 'KeyEvent'. [D:\test\grid\pluto\plutogrid\build\windows\x64\flutter\flutter_assemble.vcxproj]
/C:/Users/.../pluto_grid_plus-8.2.0/lib/src/manager/shortcut/pluto_grid_shortcut.dart(33,46): error GC2F972A8: The argument type 'RawKeyboard' can't be assigned to the parameter type 'HardwareKeyboard'. [D:\test\grid\pluto\plutogrid\build\windows\x64\flutter\flutter_assemble.vcxproj]

Execution Environment

Flutter version
Channel beta, 3.19.0-0.4.pre
environment:
sdk: '>=3.3.0-279.3.beta <4.0.0'

PlutoGrid version
8.2.0
-->

OS
Windows 11

@AndreLuizNogueira AndreLuizNogueira added the bug Something isn't working label Feb 6, 2024
@ecoant
Copy link

ecoant commented Feb 17, 2024

Hi! Someone submitted a PR to fix this on the old repo back when it was only an issue with Flutter Web
bosskmk#979

doonfrs added a commit that referenced this issue Feb 18, 2024
…ecation

Fixes #6 Migrate RawKeyboardEvent and related implications according …
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants