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

[two_dimensional_scrollables] Fixes TreeViewNode collapsing not working #7474

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/two_dimensional_scrollables/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
## NEXT
## 0.3.3

* Fixes an issue where collapsing nodes in the TreeView didn't work correctly.

## 0.3.2

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,12 @@ class _TreeViewState<T> extends State<TreeView<T>>
_currentAnimationForParent[node]!.controller.dispose();
_currentAnimationForParent.remove(node);
_updateActiveAnimations();
// If the node is collapsing, we need to unpack the active
// nodes to remove the ones that were removed from the tree.
// This is only necessary if the node is collapsing.
if (!node._expanded) {
_unpackActiveNodes();
}
case AnimationStatus.forward:
case AnimationStatus.reverse:
}
Expand Down Expand Up @@ -949,9 +955,7 @@ class _TreeViewState<T> extends State<TreeView<T>>
controller.forward();
case false:
// Collapsing
controller.reverse().then((_) {
_unpackActiveNodes();
});
controller.reverse();
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion packages/two_dimensional_scrollables/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: two_dimensional_scrollables
description: Widgets that scroll using the two dimensional scrolling foundation.
version: 0.3.2
version: 0.3.3
repository: https://github.com/flutter/packages/tree/main/packages/two_dimensional_scrollables
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+two_dimensional_scrollables%22+

Expand Down