Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed 33347 fill the gap during performLayout in SliverGrid and Slive… #33467

Merged
merged 1 commit into from
May 30, 2019

Conversation

chunhtai
Copy link
Contributor

@chunhtai chunhtai commented May 28, 2019

…rFixedExtentList

Description

Rearrange sliver children will result in gap in the middle of children list, those gap supposed be filled out during the perform layout. SliverList does fill out the gap while SliverGrid and SliverFixExtentList does not which cause crashes. This PR fixes it

Related Issues

#33347

Tests

I added the following tests:

https://github.com/chunhtai/flutter/blob/1f7ee0e65b86eda45b39a7fd8a3a0908793c337d/packages/flutter/test/widgets/slivers_test.dart#L199
https://github.com/chunhtai/flutter/blob/1f7ee0e65b86eda45b39a7fd8a3a0908793c337d/packages/flutter/test/widgets/slivers_test.dart#L221

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 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

Does your PR require Flutter developers to manually update their apps to accommodate your change?

  • No, this is not a breaking change.

@chunhtai chunhtai requested a review from goderbauer May 28, 2019 22:25
@goderbauer goderbauer added the framework flutter/packages/flutter repository. See also f: labels. label May 28, 2019
Copy link
Member

@goderbauer goderbauer left a comment

Choose a reason for hiding this comment

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

Cirrus seems to be unhappy.

Implementation looks good to me with some nits in the tests.

Text('item1', key: Key('1')),
]
));
expect(find.text('item0'), findsOneWidget);
Copy link
Member

Choose a reason for hiding this comment

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

Should we also assert that the children are in the right position after the re-arrange?

Text('item2', key: Key('2')),
]
));
expect(find.text('item0'), findsOneWidget);
Copy link
Member

Choose a reason for hiding this comment

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

Same here.

},
);

testWidgets('SliverGrid Correctly layout children after rearranging', (WidgetTester tester) async {
Copy link
Member

Choose a reason for hiding this comment

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

SliverGrid -> SliverFixedExtentList ?

)
);
}
}
Copy link
Member

Choose a reason for hiding this comment

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

nit: add a line break at the end of files

Copy link
Member

@goderbauer goderbauer left a comment

Choose a reason for hiding this comment

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

LGTM once cirrus is happy.

@chunhtai chunhtai merged commit bfc6df0 into flutter:master May 30, 2019
kiku-jw pushed a commit to kiku-jw/flutter that referenced this pull request Jun 14, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants