Skip to content

Remove nullOk parameter from Cupertino color resolution APIs #68905

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 3 commits into from
Nov 3, 2020

Conversation

gspencergoog
Copy link
Contributor

@gspencergoog gspencergoog commented Oct 23, 2020

Description

This removes the nullOk parameter from the Cupertino color resolution APIs. It changes the behavior of CupertinoDynamicColor.resolveFrom to not throw if the context does not contain the required dependencies, which was the default (and was only set to throw in a test). This allows a cascade of being able to remove the nullOk parameter from several other APIs, where they didn't actually return nullable values anyhow, it just indicated that the throwing behavior would be enabled if set to false, which made it a pretty confusing name.

Related Issues

Tests

  • Updated tests

Breaking Change

Sorry, something went wrong.

@flutter-dashboard flutter-dashboard bot added d: examples Sample code and demos 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. 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 23:00
@gspencergoog gspencergoog marked this pull request as draft October 27, 2020 23:06
@gspencergoog
Copy link
Contributor Author

This currently contains the changes also in #68905 Once that lands, I'll rebase this and take it off of draft status.

@gspencergoog gspencergoog force-pushed the remove_null_ok_2 branch 3 times, most recently from 53142c5 to fbebac6 Compare October 28, 2020 19:58
@gspencergoog gspencergoog marked this pull request as ready for review October 28, 2020 19:59
@gspencergoog
Copy link
Contributor Author

Rebased and ready for review now. This does slightly change the mechanics of these functions: specifying nullOk: false to CupertinoDynamicColor.resolveFrom used to throw, but now resolveFrom will always return a value. In our code, nobody was calling it with nullOk equal to false, so I didn't see a reason to create a maybeResolveFrom that returned default trait values and make resolveFrom throw.

Let me know if that seems like a bad idea...

Copy link
Contributor

@LongCatIsLooong LongCatIsLooong left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you!

@gspencergoog gspencergoog deleted the remove_null_ok_2 branch October 7, 2022 22:01
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. d: examples Sample code and demos 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