File tree 2 files changed +25
-2
lines changed
2 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -5944,8 +5944,7 @@ abstract class RenderObjectElement extends Element {
5944
5944
int newChildrenBottom = newWidgets.length - 1 ;
5945
5945
int oldChildrenBottom = oldChildren.length - 1 ;
5946
5946
5947
- final List <Element > newChildren = oldChildren.length == newWidgets.length ?
5948
- oldChildren : List <Element >.filled (newWidgets.length, _NullElement .instance);
5947
+ final List <Element > newChildren = List <Element >.filled (newWidgets.length, _NullElement .instance);
5949
5948
5950
5949
Element ? previousChild;
5951
5950
Original file line number Diff line number Diff line change @@ -1753,6 +1753,30 @@ The findRenderObject() method was called for the following element:
1753
1753
child.dependOnInheritedElement (ancestor);
1754
1754
expect (child.doesDependOnInheritedElement (ancestor), isTrue);
1755
1755
});
1756
+
1757
+ testWidgets (
1758
+ 'MultiChildRenderObjectElement.updateChildren test' ,
1759
+ (WidgetTester tester) async {
1760
+ // Regression test for https://github.com/flutter/flutter/issues/120762.
1761
+ final GlobalKey globalKey = GlobalKey ();
1762
+ await tester.pumpWidget (Column (
1763
+ children: < Widget > [
1764
+ const SizedBox (),
1765
+ SizedBox (key: globalKey),
1766
+ const SizedBox (),
1767
+ ],
1768
+ ));
1769
+ expect (tester.takeException (), isNull);
1770
+
1771
+ await tester.pumpWidget (Column (
1772
+ children: < Widget > [
1773
+ const SizedBox (),
1774
+ const SizedBox (),
1775
+ SizedBox (child: SizedBox (key: globalKey)),
1776
+ ],
1777
+ ));
1778
+ expect (tester.takeException (), isNull);
1779
+ });
1756
1780
}
1757
1781
1758
1782
class _TestInheritedElement extends InheritedElement {
You can’t perform that action at this time.
0 commit comments