Skip to content

Commit

Permalink
fix: use calculated size for second page instead of estimated size
Browse files Browse the repository at this point in the history
  • Loading branch information
ciriousjoker committed May 24, 2024
1 parent 8b1dc22 commit b4dd609
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/src/expandable_page_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,12 @@ class _ExpandablePageViewState extends State<ExpandablePageView> {

void _reinitializeSizes() {
final currentPageSize = _sizes[_currentPage];
_sizes = _prepareSizes();

final estimatedSizes = _prepareSizes();
for (int i = 0; i < _sizes.length; i++) {
estimatedSizes[i] = _sizes.elementAtOrNull(i) ?? estimatedSizes[i];
}
_sizes = estimatedSizes;

if (_currentPage >= _sizes.length) {
final differenceFromPreviousToCurrent = _previousPage - _currentPage;
Expand Down

0 comments on commit b4dd609

Please sign in to comment.