Skip to content

Conversation

@a14n
Copy link
Contributor

@a14n a14n commented Oct 1, 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 flutter-dashboard bot added f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. labels Oct 1, 2020
@a14n a14n requested a review from goderbauer October 1, 2020 20:31
Copy link
Contributor

@gspencergoog gspencergoog left a comment

Choose a reason for hiding this comment

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

32384589-a60f0e74-c078-11e7-9bc1-e5b5287aea9d

Modulo the one comment. Thanks!

@goderbauer
Copy link
Member

Can you rebase this perform submitting it? I recently added a field to MaterialApp (restorationScopeId), which probably needs to be marked as nullable as part of this PR to avoid breakage, but it's not included in this PR, yet.

Sorry for the inconvenience...

@a14n a14n force-pushed the nnbd-material-part branch from 318a5d7 to ec27174 Compare October 2, 2020 20:08
@a14n
Copy link
Contributor Author

a14n commented Oct 2, 2020

Rebased.

showSelectedLabels: showSelectedLabels ?? bottomTheme.showUnselectedLabels,
showUnselectedLabels: showUnselectedLabels ?? bottomTheme.showUnselectedLabels,
selectedLabelStyle: selectedLabelStyle,
unselectedLabelStyle: unselectedLabelStyle,
Copy link
Contributor

Choose a reason for hiding this comment

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

fyi @HansMuller not sure if this was the intended design but this does match what we had before. Maybe we should make selectedLabelStyle and unselectedLabelStyle nullable in some future PR?

Copy link
Contributor

Choose a reason for hiding this comment

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

This looks like an obvious error for which I assume we had no test coverage. This widget is supposed to be "conventional", non-null style parameters override defaults valued computed by the widget.

CC @johnsonmh

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the catch, this PR should fix the bug and make desired nullability more clear: #67342

flex: _evaluateFlex(_animations[i]),
selected: i == widget.currentIndex,
showSelectedLabels: widget.showSelectedLabels ?? bottomTheme.showSelectedLabels,
showSelectedLabels: widget.showSelectedLabels,
Copy link
Contributor

Choose a reason for hiding this comment

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

cc @HansMuller similar here

Copy link
Contributor

Choose a reason for hiding this comment

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

Same reply as above.

const BottomSheet({
Key key,
Key? key,
this.animationController,
Copy link
Contributor

Choose a reason for hiding this comment

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

looks like this should be required

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But there are place where no animationController is passed. And sometimes a nullable value is passed as well.

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.

Some minor comments but overall LGTM.

I suspect we'll have to do some cleanup later, for example making Theme.of non-nullable, but that will require deeper work (e.g. creating a migration guide, deprecations, etc) which aren't appropriate here.

@a14n a14n merged commit 8143992 into flutter:master Oct 2, 2020
@a14n a14n deleted the nnbd-material-part branch October 2, 2020 21:10
goderbauer added a commit that referenced this pull request Oct 3, 2020
renyou pushed a commit that referenced this pull request Oct 3, 2020
}

Future<void> close() {
Future<void> close() async {
Copy link
Member

Choose a reason for hiding this comment

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

This change (making close() async) caused the test failures in google3 because it's changing the timing in tests slightly. I am going to make this non-async again to restore the old behavior.

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