Skip to content
This repository was archived by the owner on Oct 13, 2025. It is now read-only.

Conversation

@fengzhichu
Copy link

Description

if a list view using linked scroll controller is unmounted in some cases, when it is remounted the position will lost. This commit can fix it.

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 signed the CLA.
  • All tests from running flutter test pass.
  • flutter analyze does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

if a list view using linked scroll controller is unmounted in some cases, when it is remounted the position will lost. This commit can fix it.
@google-cla google-cla bot added the cla: yes CLA has been signed by all contributors label Sep 26, 2020
@jamesderlin jamesderlin assigned tarobins and unassigned tarobins Sep 26, 2020
@jamesderlin jamesderlin added the p: linked_scroll_controller Related to package:linked_scroll_controller label Sep 26, 2020
@jamesderlin jamesderlin requested a review from mehmetf October 8, 2020 11:09
Copy link
Contributor

@mehmetf mehmetf left a comment

Choose a reason for hiding this comment

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

LGTM

@mehmetf
Copy link
Contributor

mehmetf commented Oct 8, 2020

Please also update CHANGELOG and pubspec version.

@mehmetf
Copy link
Contributor

mehmetf commented Oct 8, 2020

@robertoscaramuzzi Could you please take a look at this?


if (oldPosition == null && _controllers._attachedControllers.isNotEmpty) {
final position = _controllers._attachedControllers.first.position;
if (newPosition.minScrollExtent == null &&
Copy link

@fryette fryette Dec 1, 2020

Choose a reason for hiding this comment

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

it's throwing an exception because minScrollExtent cannot be null, and if private _minScrollExtent null->exception throws

@fryette
Copy link

fryette commented Dec 1, 2020

These changes broke the package

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes CLA has been signed by all contributors p: linked_scroll_controller Related to package:linked_scroll_controller

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants