Skip to content

Commit 829491b

Browse files
committed
[fix] dynamic generation of children causes overflow
1 parent d8cd4c3 commit 829491b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/lazy_load_indexed_stack.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ class LazyLoadIndexedStackState extends State<LazyLoadIndexedStack> {
5757
void didUpdateWidget(final LazyLoadIndexedStack oldWidget) {
5858
super.didUpdateWidget(oldWidget);
5959

60+
if (widget.children.length != oldWidget.children.length) {
61+
_children = _initialChildren();
62+
}
63+
6064
_children[widget.index] = widget.children[widget.index];
6165
}
6266

0 commit comments

Comments
 (0)