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

Remove nullOk parameter from Shortcuts.of, Actions.find, and Actions.handler #68921

Merged
merged 1 commit into from Oct 29, 2020

Conversation

gspencergoog
Copy link
Contributor

@gspencergoog gspencergoog commented Oct 23, 2020

Description

This removes the nullOk parameter from Shortcuts.of, Actions.find and Actions.handler and created Shortcuts.maybeOf and Actions.maybeFind. Shortcuts.of and Actions.find now return non-nullable values, and the maybe versions return a nullable value. I didn't create a non-nullable version of Actions.handler, since it needs to be able to return null if an action is not enabled, but I did remove the nullOk parameter, effectively setting it to true permanently, since setting it to false doesn't make much sense if the function can still return null when the action is not enabled.

Related Issues

Tests

  • Updated tests to use maybeOf appropriately, added tests for Shortcuts.of and Shortcuts.maybeOf.

Breaking Change

@flutter-dashboard flutter-dashboard bot added framework flutter/packages/flutter repository. See also f: labels. work in progress; do not review labels Oct 23, 2020
@google-cla google-cla bot added the cla: yes label Oct 23, 2020
@gspencergoog gspencergoog marked this pull request as ready for review October 27, 2020 22:55
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

packages/flutter/lib/src/widgets/actions.dart Outdated Show resolved Hide resolved
packages/flutter/lib/src/widgets/actions.dart Outdated Show resolved Hide resolved
packages/flutter/lib/src/widgets/actions.dart Outdated Show resolved Hide resolved
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.

None yet

2 participants