Skip to content

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

Merged
gspencergoog merged 1 commit intoflutter:masterfrom
gspencergoog:invoke_nullok
Jan 26, 2021
Merged

Remove nullOk from Actions.invoke, add Actions.maybeInvoke#74680
gspencergoog merged 1 commit intoflutter:masterfrom
gspencergoog:invoke_nullok

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

@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