-
Notifications
You must be signed in to change notification settings - Fork 29.1k
Skip HardwareKeyboard asserts until keyboard state is initialized #172154
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
base: master
Are you sure you want to change the base?
Conversation
It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging. If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group. |
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
You've included some unwanted files. I don't think it's okay to add terminal output colors to assert messages. |
129fe19
to
beee39e
Compare
@justinmc The changes are now ready for review. I’d greatly appreciate your feedback. |
*Prevent assertion error in HardwareKeyboard during app startup
Details:
Added a _keyboardStateInitialized flag to HardwareKeyboard.
The assertion in _assertEventIsRegular is now skipped until the keyboard state is initialized (after syncKeyboardState() runs).
This prevents assertion errors if key events are received before the keyboard state is fully synchronized, such as during app startup or hot reload.
Motivation:
Fixes an issue where key events during app loading could trigger an assertion failure, improving robustness during initialization.
*
#172153
If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.