Skip to content

Commit e7a1dd0

Browse files
Anthony GordonAnthony Gordon
authored andcommitted
fix: CollectionView not updating when parent rebuilds with new data
Added didUpdateWidget override to reset _syncDataInitialized flag on parent rebuilds, restoring filtering/search behavior broken in v7.16.0 while preserving stateActions functionality. Added 29 tests for CollectionView and CollectionItem.
1 parent 9c7f6f4 commit e7a1dd0

4 files changed

Lines changed: 577 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
## [7.18.1] - 2026-04-11
2+
3+
### Fixed
4+
5+
* **CollectionView not updating when parent rebuilds with new data** - Sync data callbacks (e.g. `data: () => _filteredList`) were only read once due to `_syncDataInitialized` flag introduced in v7.16.0, breaking filtering/search patterns. Added `didUpdateWidget` override to reset the flag on parent rebuilds while preserving `stateActions` behavior
6+
7+
### Added
8+
9+
* **CollectionView test coverage** - Added 29 tests covering `CollectionItem` helpers, sync/async data, empty states, headers, spacing, transform/sort, separated/grid layouts, parent-driven data updates, and configuration options
10+
111
## [7.18.0] - 2026-04-11
212

313
### Added

lib/widgets/src/collection_view.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,12 @@ class _CollectionViewState<T> extends NyState<CollectionView<T>> {
529529
super.initState();
530530
}
531531

532+
@override
533+
void didUpdateWidget(covariant CollectionView<T> oldWidget) {
534+
super.didUpdateWidget(oldWidget);
535+
_syncDataInitialized = false;
536+
}
537+
532538
@override
533539
void dispose() {
534540
_refreshController.dispose();

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: nylo_support
22
description: Support library for the Nylo framework. This library supports routing, widgets, localization, cli, storage and more.
3-
version: 7.18.0
3+
version: 7.18.1
44
homepage: https://nylo.dev
55
repository: https://github.com/nylo-core/support/tree/7.x
66
issue_tracker: https://github.com/nylo-core/support/issues

0 commit comments

Comments
 (0)