File tree Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Expand file tree Collapse file tree 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 {
59445944 int newChildrenBottom = newWidgets.length - 1 ;
59455945 int oldChildrenBottom = oldChildren.length - 1 ;
59465946
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);
59495948
59505949 Element ? previousChild;
59515950
Original file line number Diff line number Diff line change @@ -1753,6 +1753,30 @@ The findRenderObject() method was called for the following element:
17531753 child.dependOnInheritedElement (ancestor);
17541754 expect (child.doesDependOnInheritedElement (ancestor), isTrue);
17551755 });
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+ });
17561780}
17571781
17581782class _TestInheritedElement extends InheritedElement {
You can’t perform that action at this time.
0 commit comments