Skip to content

Remove the nullOk parameter from Navigator.of and add Navigator.maybeOf #70726

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
Nov 20, 2020

Conversation

gspencergoog
Copy link
Contributor

Description

Adds Navigator.maybeOf to replace calling Navigator.of(context, nullOk: true), and removes the nullOk parameter. Also changes Navigator.of to return a non-nullable value, and removes many (120!) instances of the ! operator, reducing the possible places where a null dereference could occur.

Related Issues

Tests

  • No tests were harmed in the making of this PR.
  • Added tests to make sure that of, maybeOf work as expected.

Breaking Change

  • Yes, this is a breaking change that will require a migration guide.

Sorry, something went wrong.

@flutter-dashboard flutter-dashboard bot added f: cupertino flutter/packages/flutter/cupertino repository f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. c: contributor-productivity Team-specific productivity, code health, technical debt. labels Nov 17, 2020
@google-cla google-cla bot added the cla: yes label Nov 17, 2020
@gspencergoog gspencergoog changed the title Remove the nullOk parameter from Navigator.of and add Navigator.maybeOf Remove the nullOk parameter from Navigator.of and add Navigator.maybeOf Nov 17, 2020
@gspencergoog gspencergoog force-pushed the remove_navigator_nullok branch from dc34d3c to 6e089c2 Compare November 17, 2020 23:24
@gspencergoog gspencergoog force-pushed the remove_navigator_nullok branch from 6e089c2 to 462d78e Compare November 18, 2020 00:58
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 de884f1 into flutter:master Nov 20, 2020
@gspencergoog gspencergoog deleted the remove_navigator_nullok branch November 20, 2020 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: contributor-productivity Team-specific productivity, code health, technical debt. f: cupertino flutter/packages/flutter/cupertino repository f: material design flutter/packages/flutter/material repository. 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