Repository: flutter
Issue: ListView -> GridTile -> `footer` or `header` with Column (or Row) throws exceptions
Labels: c: crash,framework,f: material design,f: scrolling,has reproducible steps,P2,found in release: 3.7,found in release: 3.11,team-design,triaged-design

## Steps to Reproduce

Inside ListView add GridTile with either `footer` or `header` containing a Column (or Row)

Remarkably, there's no problem if Column (or Row) is specified to `child`, or if the GridTile is constrained (e.g. wrapped in SizedBox)

**Expected results:** no exceptions

**Actual results:** exception

<details>
  <summary>Code sample</summary>

```dart
import 'package:flutter/material.dart';

void main() => runApp(App());

class App extends StatelessWidget {
  static const String _title = 'Flutter Code Sample';

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: _title,
      home: Scaffold(
        body: Container(
          height: 100.0,
          child: ListView.builder(
            scrollDirection: Axis.horizontal,
            itemCount: 1,
            itemBuilder: (context, index) {
              return Container(
                child: GridTile(
                  child: Container(
                    height: 100.0,
                    width: 100.0,
                    color: Colors.red,
                  ),
                  
                  // Either of these below will throw

                  footer: Row(
                    mainAxisSize: MainAxisSize.min,
                    children: [
                      Text('text'),
                      Text('text'),
                    ]),

                  header: Row(
                    mainAxisSize: MainAxisSize.min,
                    children: [
                      Text('text'),
                      Text('text'),
                    ]),
                ),
              );
            }
          ),
        ),
      ),
    );
  }
}
```
</details>

<details>
  <summary>Logs</summary>

```
══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════
The following assertion was thrown during performLayout():
'package:flutter/src/rendering/stack.dart': Failed assertion: line 588 pos 12: 'size.isFinite': is
not true.

Either the assertion indicates an error in the framework itself, or we should provide substantially
more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
  https://github.com/flutter/flutter/issues/new?template=2_bug.md

The relevant error-causing widget was:
  GridTile file:///C:/dev/projects/issues/lib/main.dart:20:24

When the exception was thrown, this was the stack:
#2      RenderStack._computeSize (package:flutter/src/rendering/stack.dart:588:12)
#3      RenderStack.performLayout (package:flutter/src/rendering/stack.dart:597:12)
#4      RenderObject.layout (package:flutter/src/rendering/object.dart:1788:7)
#5      RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:116:14)
#6      RenderObject.layout (package:flutter/src/rendering/object.dart:1788:7)
#7      RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:116:14)
#8      RenderObject.layout (package:flutter/src/rendering/object.dart:1788:7)
#9      RenderSliverList.performLayout (package:flutter/src/rendering/sliver_list.dart:213:28)
#10     RenderObject.layout (package:flutter/src/rendering/object.dart:1788:7)
#11     RenderSliverEdgeInsetsPadding.performLayout (package:flutter/src/rendering/sliver_padding.dart:137:12)
#12     RenderSliverPadding.performLayout (package:flutter/src/rendering/sliver_padding.dart:371:11)
#13     RenderObject.layout (package:flutter/src/rendering/object.dart:1788:7)
#14     RenderViewportBase.layoutChildSequence (package:flutter/src/rendering/viewport.dart:510:13)
#15     RenderViewport._attemptLayout (package:flutter/src/rendering/viewport.dart:1574:12)
#16     RenderViewport.performLayout (package:flutter/src/rendering/viewport.dart:1483:20)
#17     RenderObject.layout (package:flutter/src/rendering/object.dart:1788:7)
#18     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:116:14)
#19     RenderObject.layout (package:flutter/src/rendering/object.dart:1788:7)
#20     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:116:14)
#21     RenderObject.layout (package:flutter/src/rendering/object.dart:1788:7)
#22     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:116:14)
#23     RenderObject.layout (package:flutter/src/rendering/object.dart:1788:7)
#24     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:116:14)
#25     RenderObject.layout (package:flutter/src/rendering/object.dart:1788:7)
#26     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:116:14)
#27     RenderObject.layout (package:flutter/src/rendering/object.dart:1788:7)
#28     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:116:14)
#29     RenderObject.layout (package:flutter/src/rendering/object.dart:1788:7)
#30     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:116:14)
#31     RenderObject.layout (package:flutter/src/rendering/object.dart:1788:7)
#32     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:116:14)
#33     RenderCustomPaint.performLayout (package:flutter/src/rendering/custom_paint.dart:545:11)
#34     RenderObject.layout (package:flutter/src/rendering/object.dart:1788:7)
#35     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:116:14)
#36     RenderObject.layout (package:flutter/src/rendering/object.dart:1788:7)
#37     RenderConstrainedBox.performLayout (package:flutter/src/rendering/proxy_box.dart:277:14)
#38     RenderObject.layout (package:flutter/src/rendering/object.dart:1788:7)
#39     MultiChildLayoutDelegate.layoutChild (package:flutter/src/rendering/custom_layout.dart:171:12)
#40     _ScaffoldLayout.performLayout (package:flutter/src/material/scaffold.dart:937:7)
#41     MultiChildLayoutDelegate._callPerformLayout (package:flutter/src/rendering/custom_layout.dart:240:7)
#42     RenderCustomMultiChildLayoutBox.performLayout (package:flutter/src/rendering/custom_layout.dart:404:14)
#43     RenderObject.layout (package:flutter/src/rendering/object.dart:1788:7)
#44     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:116:14)
#45     RenderObject.layout (package:flutter/src/rendering/object.dart:1788:7)
#46     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:116:14)
#47     _RenderCustomClip.performLayout (package:flutter/src/rendering/proxy_box.dart:1388:11)
#48     RenderObject.layout (package:flutter/src/rendering/object.dart:1788:7)
#49     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:116:14)
#50     RenderObject.layout (package:flutter/src/rendering/object.dart:1788:7)
#51     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:116:14)
#52     RenderObject.layout (package:flutter/src/rendering/object.dart:1788:7)
#53     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:116:14)
#54     RenderObject.layout (package:flutter/src/rendering/object.dart:1788:7)
#55     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:116:14)
#56     RenderObject.layout (package:flutter/src/rendering/object.dart:1788:7)
#57     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:116:14)
#58     RenderObject.layout (package:flutter/src/rendering/object.dart:1788:7)
#59     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:116:14)
#60     RenderObject.layout (package:flutter/src/rendering/object.dart:1788:7)
#61     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:116:14)
#62     RenderObject.layout (package:flutter/src/rendering/object.dart:1788:7)
#63     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:116:14)
#64     RenderOffstage.performLayout (package:flutter/src/rendering/proxy_box.dart:3389:13)
#65     RenderObject.layout (package:flutter/src/rendering/object.dart:1788:7)
#66     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:116:14)
#67     RenderObject.layout (package:flutter/src/rendering/object.dart:1788:7)
#68     _RenderTheatre.performLayout (package:flutter/src/widgets/overlay.dart:745:15)
#69     RenderObject.layout (package:flutter/src/rendering/object.dart:1788:7)
#70     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:116:14)
#71     RenderObject.layout (package:flutter/src/rendering/object.dart:1788:7)
#72     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:116:14)
#73     RenderObject.layout (package:flutter/src/rendering/object.dart:1788:7)
#74     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:116:14)
#75     RenderObject.layout (package:flutter/src/rendering/object.dart:1788:7)
#76     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:116:14)
#77     RenderCustomPaint.performLayout (package:flutter/src/rendering/custom_paint.dart:545:11)
#78     RenderObject.layout (package:flutter/src/rendering/object.dart:1788:7)
#79     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:116:14)
#80     RenderObject.layout (package:flutter/src/rendering/object.dart:1788:7)
#81     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:116:14)
#82     RenderObject.layout (package:flutter/src/rendering/object.dart:1788:7)
#83     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:116:14)
#84     RenderObject.layout (package:flutter/src/rendering/object.dart:1788:7)
#85     RenderView.performLayout (package:flutter/src/rendering/view.dart:153:14)
#86     RenderObject._layoutWithoutResize (package:flutter/src/rendering/object.dart:1644:7)
#87     PipelineOwner.flushLayout (package:flutter/src/rendering/object.dart:881:18)
#88     RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:462:19)
#89     WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:879:13)
#90     RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:328:5)
#91     SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1147:15)
#92     SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1084:9)
#93     SchedulerBinding.scheduleWarmUpFrame.<anonymous closure> (package:flutter/src/scheduler/binding.dart:867:7)
(elided 13 frames from class _AssertionError, class _RawReceivePortImpl, class _Timer, dart:async, and dart:async-patch)

The following RenderObject was being processed when the exception was fired: RenderStack#bc944 relayoutBoundary=up5 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE:
  creator: Stack ← GridTile ← Container ← RepaintBoundary ← IndexedSemantics ←
    NotificationListener<KeepAliveNotification> ← KeepAlive ← AutomaticKeepAlive ← KeyedSubtree ←
    SliverList ← MediaQuery ← SliverPadding ← ⋯
  parentData: <none> (can use size)
  constraints: BoxConstraints(0.0<=w<=Infinity, h=100.0)
  size: MISSING
  alignment: AlignmentDirectional.topStart
  textDirection: ltr
  fit: loose
This RenderObject had the following descendants (showing up to depth 5):
    child 1: RenderConstrainedBox#f118b NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
      child: _RenderColoredBox#b4003 NEEDS-LAYOUT NEEDS-PAINT
    child 2: RenderFlex#c6fd4 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
      child 1: RenderParagraph#e0b4b NEEDS-LAYOUT NEEDS-PAINT
        text: TextSpan
      child 2: RenderParagraph#f3fde NEEDS-LAYOUT NEEDS-PAINT
        text: TextSpan
    child 3: RenderFlex#d2673 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
      child 1: RenderParagraph#927a3 NEEDS-LAYOUT NEEDS-PAINT
        text: TextSpan
      child 2: RenderParagraph#37d21 NEEDS-LAYOUT NEEDS-PAINT
        text: TextSpan
════════════════════════════════════════════════════════════════════════════════════════════════════

Another exception was thrown: RenderBox was not laid out: RenderStack#bc944 relayoutBoundary=up5 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE

Another exception was thrown: RenderBox was not laid out: RenderRepaintBoundary#6abef relayoutBoundary=up4 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE

Another exception was thrown: 'package:flutter/src/rendering/sliver_multi_box_adaptor.dart': Failed assertion: line 544 pos 12: 'child.hasSize': is not true.

Another exception was thrown: Null check operator used on a null value

Another exception was thrown: Null check operator used on a null value

Another exception was thrown: Null check operator used on a null value
```

```
Analyzing issues...                                                     

   info - Unused import: 'package:flutter_issue/main.dart' - test\widget_test.dart:2:8 - unused_import

1 issue found. (ran in 2.9s)
```

```
[✓] Flutter (Channel master, 2.3.0-1.0.pre.229, on Microsoft Windows [Version 10.0.19041.928], locale ru-RU)
    • Flutter version 2.3.0-1.0.pre.229 at C:\dev\src\flutter
    • Upstream repository git@github.com:nt4f04und/flutter.git
    • Framework revision 14d5eab43c (2 days ago), 2021-05-05 21:51:53 -0700
    • Engine revision 378e4dbc41
    • Dart version 2.14.0 (build 2.14.0-48.0.dev)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at C:\Users\danya\AppData\Local\Android\sdk
    • Platform android-30, build-tools 30.0.2
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[✓] Visual Studio - develop for Windows (Visual Studio Community 2019 16.7.7)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.7.30621.155
    • Windows 10 SDK version 10.0.19041.0

[✓] Android Studio (version 4.1.0)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[✓] IntelliJ IDEA Community Edition (version 2020.3)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2020.3.3
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.56.0)
    • VS Code at C:\Users\danya\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.22.0

[✓] Connected device (5 available)
    • Redmi Note 5 (mobile)   • 40c9f14       • android-arm64  • Android 9 (API 28)
    • sdk gphone x86 (mobile) • emulator-5554 • android-x86    • Android 11 (API 30) (emulator)
    • Windows (desktop)       • windows       • windows-x64    • Microsoft Windows [Version 10.0.19041.928]
    • Chrome (web)            • chrome        • web-javascript • Google Chrome 90.0.4430.93
    • Edge (web)              • edge          • web-javascript • Microsoft Edge 90.0.818.46

• No issues found!
```

</details>