Conversation
This comment has been minimized.
This comment has been minimized.
b8aa3f6 to
839f517
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
b33ea19 to
2f0c561
Compare
|
Marking this PR as ready for review triggered a whole bunch of new checks. Probably worthwhile to wait and see if all those pass before starting a review. |
|
Looks like they passed. Yay! I'll take a look at this tomorrow. |
There was a problem hiding this comment.
| Future<HttpClientResponse> get done { | |
| return Future<HttpClientResponse>.value(_MockHttpResponse()); | |
| } | |
| Future<HttpClientResponse> get done async => _MockHttpResponse(); |
There was a problem hiding this comment.
| final RenderBox renderObject = element.renderObject as RenderBox; | |
| final RenderBox renderObject = element.renderObject! as RenderBox; |
There was a problem hiding this comment.
Perhaps throwing something is better here?
There was a problem hiding this comment.
| final RenderRepaintBoundary boundary = boundaryKey.currentContext!.findRenderObject() as RenderRepaintBoundary; | |
| final RenderRepaintBoundary boundary = boundaryKey.currentContext!.findRenderObject()! as RenderRepaintBoundary; |
There was a problem hiding this comment.
| renderObject = renderObject.parent as RenderObject; | |
| renderObject = renderObject.parent! as RenderObject; |
2f0c561 to
d19b8ec
Compare
There was a problem hiding this comment.
Doesn't casting it to Object (as opposed to Object?) imply the !?
There was a problem hiding this comment.
Yes, it does. But @a14n is working on a lint that will require you to specifically think about null and add the ! to say that you thought about nullability and this cannot be null here.
There was a problem hiding this comment.
OK. When that lint is turned on, I'm sure we'll have a bunch of places to fix.
There was a problem hiding this comment.
Yeah, a14n has already been fixing up our code base in prep for that.
|
@a14n @gspencergoog All comments addressed. Thanks for the review! PTAL. |
|
While trying this change out in the google codebase I noticed a minor setback: Since in google internally, a lib can only have null safety turned on when all its imports are also null safe, we will have to migrate material's /cc @a14n @gspencergoog |
There was a problem hiding this comment.
should we check if renderObject is non-null? Or is it more or less guaranteed to be?
There was a problem hiding this comment.
similar here; what if someone ends up calling this before layout/paint have run? you can change the phase in a test.
There was a problem hiding this comment.
yikes, do we document / check that this is only used with RenderBoxes?
There was a problem hiding this comment.
I added an assert. Currently, it is guaranteed that the renderObject will always be a RenderBox because the element finder above only returns Elements of Text or Editable widgets, which will always have RenderBox elements.
There was a problem hiding this comment.
nit: switch ((space before(`)
There was a problem hiding this comment.
Yes, I saw this when I did my review, and it simplifies other code here, but doesn't change behavior, so a net win.
There was a problem hiding this comment.
i wonder how many people ever use this and whether we should just remove it. I don't think I've used it once since implementing it.
There was a problem hiding this comment.
(just an idle thought unrelated to this PR obviously)
4738563 to
71a7d08
Compare
71a7d08 to
6316779
Compare
Description
Migrates
flutter_testto null-safety.I will migrate the tests of this package in a separate PR.
Related Issues
Fixes #53908.
Tests
I added the following tests:
n/a
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.///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change
Did any tests fail when you ran them? Please read Handling breaking changes.