Skip to content

Conversation

a14n
Copy link
Contributor

@a14n a14n commented Sep 25, 2020

Description

NNBD migration for part of material

Related Issues

Tests

I added the following tests:

None

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Did any tests fail when you ran them? Please read Handling breaking changes.

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@flutter-dashboard flutter-dashboard bot added f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. labels Sep 25, 2020
Copy link
Contributor

@Hixie Hixie left a comment

Choose a reason for hiding this comment

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

LGTM except for material_state.dart which I'd like @johnsonmh to review.

@@ -224,15 +222,15 @@ abstract class MaterialStateMouseCursor extends MouseCursor implements MaterialS
@protected
@override
MouseCursorSession createSession(int device) {
return resolve(<MaterialState>{}).createSession(device);
return resolve(<MaterialState>{})!.createSession(device);
Copy link
Contributor

Choose a reason for hiding this comment

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

@dkwingsmt Can you take a look at this? In general resolve will return a nullable type, I worry that this ! isn't safe and should maybe look something more like:

return resolve(<MaterialState>{})?.createSession(device) ?? _defaultMouseCursor.createSession(device);

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes. In most (all) cases, if MaterialState's resolve method returns null, that indicates that the widget should defer to the next most general default.

Copy link
Contributor

@HansMuller HansMuller left a comment

Choose a reason for hiding this comment

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

LGTM although line 225 in material_state.dart should be reconsidered for a followup change.

@a14n
Copy link
Contributor Author

a14n commented Sep 27, 2020

Could a googler check why Google testing is still Pending?

@renyou
Copy link
Contributor

renyou commented Sep 27, 2020

We have some infra problem and cannot fetch this PR correctly. Looking into it now.

@renyou
Copy link
Contributor

renyou commented Sep 27, 2020

This has something to do with the API we use. I will try to fix this by EOB Monday.

@fluttergithubbot fluttergithubbot merged commit a01113d into flutter:master Sep 28, 2020
@a14n a14n deleted the nnbd-material-part branch September 28, 2020 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

7 participants