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

build fails with KeyEventResult type errors #52

Open
ghost opened this issue Sep 29, 2021 · 2 comments
Open

build fails with KeyEventResult type errors #52

ghost opened this issue Sep 29, 2021 · 2 comments

Comments

@ghost
Copy link

ghost commented Sep 29, 2021

(latest flutter on ubuntu)

> flutter run -d linux
Running "flutter pub get" in flokk_src...                          15.8s
Launching lib/main.dart on Linux in debug mode...
ERROR: lib/styled_components/styled_text_input.dart:149:20: Error: A value of type 'bool' can't be returned from a function with return type 'KeyEventResult'.
ERROR:  - 'KeyEventResult' is from 'package:flutter/src/widgets/focus_manager.dart' ('/home/dym/snap/flutter/common/flutter/packages/flutter/lib/src/widgets/focus_manager.dart').
ERROR:             return true;
ERROR:                    ^
ERROR: lib/styled_components/styled_text_input.dart:152:16: Error: A value of type 'bool' can't be returned from a function with return type 'KeyEventResult'.
ERROR:  - 'KeyEventResult' is from 'package:flutter/src/widgets/focus_manager.dart' ('/home/dym/snap/flutter/common/flutter/packages/flutter/lib/src/widgets/focus_manager.dart').
ERROR:         return false;
ERROR:                ^
ERROR: lib/views/search/search_bar_view.dart:46:14: Error: The argument type 'bool Function(FocusNode, RawKeyEvent)' can't be assigned to the parameter type 'KeyEventResult Function(FocusNode, RawKeyEvent)?'.
ERROR:  - 'FocusNode' is from 'package:flutter/src/widgets/focus_manager.dart' ('/home/dym/snap/flutter/common/flutter/packages/flutter/lib/src/widgets/focus_manager.dart').
ERROR:  - 'RawKeyEvent' is from 'package:flutter/src/services/raw_keyboard.dart' ('/home/dym/snap/flutter/common/flutter/packages/flutter/lib/src/services/raw_keyboard.dart').
ERROR:  - 'KeyEventResult' is from 'package:flutter/src/widgets/focus_manager.dart' ('/home/dym/snap/flutter/common/flutter/packages/flutter/lib/src/widgets/focus_manager.dart').
ERROR:       onKey: _handleKeyPress,
ERROR:              ^
Building Linux application...
Exception: Build process failed
@sucheolha
Copy link

I've modified 'true' to 'KeyEventResult.handled' and 'false' to 'KeyEventResult.ignored'. I didn't test it yet but built successfully.

@dickens7
Copy link

you can refer to this 0330b7c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants