Skip to content

Remove nullOk from Actions.invoke, add Actions.maybeInvoke #74680

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

Merged
merged 1 commit into from
Jan 26, 2021

Conversation

gspencergoog
Copy link
Contributor

Description

This removes the nullOk parameter from Actions.invoke, and adds an Actions.maybeInvoke function. The difference is that invoke will now always (in debug mode) throw if an enabled action isn't found, and maybeInvoke will return null if an enabled action isn't found. The invoke function can still return null as the result of the invocation, though, so I purposely didn't change the return value to Object from Object?.

Related Issues

Tests

  • Added tests for maybeInvoke, updated invoke tests.

Breaking Change

Sorry, something went wrong.

@flutter-dashboard flutter-dashboard bot added the framework flutter/packages/flutter repository. See also f: labels. label Jan 25, 2021
@google-cla google-cla bot added the cla: yes label Jan 25, 2021
Copy link
Member

@goderbauer goderbauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gspencergoog gspencergoog merged commit 2eeeba9 into flutter:master Jan 26, 2021
@gspencergoog gspencergoog deleted the invoke_nullok branch January 26, 2021 04:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Some widgets' nullOk parameters are inconsistently applied.
2 participants