Pass fit property to RenderIndexedStack#109295
Conversation
|
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 (don't just cc him here, he won't see it! He's on 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. |
|
Could you add |
|
@xu-baolin sure |
|
Would this require any tests? |
|
yes this needs tests. |
| assert(_debugCheckHasDirectionality(context)); | ||
| return RenderIndexedStack( | ||
| index: index, | ||
| fit:fit, |
There was a problem hiding this comment.
RO should add clipBehavior too
| assert(_debugCheckHasDirectionality(context)); | ||
| renderObject | ||
| ..index = index | ||
| ..fit = fit |
There was a problem hiding this comment.
updateRenderObject also needs to update the clipBehavior on the RenderObject.
| (WidgetTester tester) async { | ||
| await tester.pumpWidget(IndexedStack(textDirection: TextDirection.ltr)); | ||
| final RenderIndexedStack renderObject = | ||
| tester.allRenderObjects.whereType<RenderIndexedStack>().first; |
There was a problem hiding this comment.
Probably a little more idiomatic:
| tester.allRenderObjects.whereType<RenderIndexedStack>().first; | |
| tester.renderObject<RenderIndexedStack>(find.type(IndexedStack)); |
| clipBehavior: Clip.antiAlias, | ||
| )); | ||
| final RenderIndexedStack renderIndexedObject = | ||
| tester.allRenderObjects.whereType<RenderIndexedStack>().first; |
| tester.allRenderObjects.whereType<RenderIndexedStack>().first; | ||
| expect(renderIndexedObject.clipBehavior, equals(Clip.antiAlias)); | ||
| }); | ||
| } |
There was a problem hiding this comment.
Can you also add a test for the fit property?
| tester.allRenderObjects.whereType<RenderIndexedStack>().first; | ||
| expect(renderObject.clipBehavior, equals(Clip.hardEdge)); | ||
|
|
||
| /// Update clipBehavior to Clip.antiAlias |
Pass fit property from IndexedStack to RenderIndexedStack so as to fit Children within a Stack
Fixes: #109247
If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.