flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
162.17k stars 26.65k forks source link

Refactor `Material` build method #147430

Open nate-thegrate opened 2 weeks ago

nate-thegrate commented 2 weeks ago

I made a lot of random tweaks while working on issue #147392, so I thought it'd be good to file these changes as a separate pull request so that eventually the main PR will be easier to review.

Currently, the Material build method makes multiple calls to Theme.of(context), and _MaterialInterior has a nullable shadowColor (even though the values passed to it are always non-nullable).


Commit 3ffb2e0 reverts a change to the elevation calculation, so golden test files should no longer be affected.

flutter-dashboard[bot] commented 2 weeks ago

Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change).

If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review.

For more guidance, visit Writing a golden file test for package:flutter.

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

Changes reported for pull request #147430 at sha d6dde8a7336c333b2680e1681e60506ec8f672f1

flutter-dashboard[bot] commented 2 weeks ago

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 "@test-exemption-reviewer" in the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

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

Hixie commented 2 weeks ago

test-exempt: code refactor with no semantic change (i did not review the code to verify that there are no semantic changes, only that that was the intent)