Repository: flutter
Issue: [proposal] Allow Horizontal ListView with Vertical ListView Children Without Fixed Height
Labels: c: new feature,framework,f: scrolling,c: proposal,P3,team-framework,triaged-framework

Recreated from https://github.com/flutter/flutter/issues/16564

Currently, it's not possible to have Vertical listviews wrapped in horizontal Listview without giving a fixed height. 
It should be possible to let the content decide the height instead of hard coding a specific height. This is already achievable in native Android development. 

### Steps to reproduce 
1. Run this code sample on any Flutter channel which has a fixed height of `500`, it is suitable for one type of content but totally oversized for another type of content. If I change the height to `200`, it matches the other content but not the earlier one 
2. Click on FAB to switch content (which simulates a dynamic content app Something like a shopping app/ a news app).

<details>
<summary>code sample</summary>

```dart
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Material App',
      theme: ThemeData.dark(),
      home: Home(),
    );
  }
}

class Home extends StatefulWidget {
  @override
  _HomeState createState() => _HomeState();
}

class _HomeState extends State<Home> {
  String dash = "https://i.imgur.com/QCNbOAo.png";
  String interact = "https://i.imgur.com/Miut7UP.png";
  bool switchContent = false;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Material App Bar'),
      ),
      body: Center(
        child: ListView.builder(
          itemCount: 3,
          itemBuilder: (BuildContext context, int index) {
            return Container(
              height: 500,
              child: ListView.builder(
                scrollDirection: Axis.horizontal,
                itemCount: 20,
                itemBuilder: (BuildContext context, int index) {
                  return switchContent
                      ? Container(
                          height: 200,
                          width: 200,
                          child: Image.network(dash, fit: BoxFit.cover),
                        )
                      : Container(
                          height: 500,
                          width: 900,
                          child: Image.network(
                            interact,
                            fit: BoxFit.cover,
                          ),
                        );
                },
              ),
            );
          },
        ),
      ),
      floatingActionButton: FloatingActionButton.extended(
        label: Text('Change Content'),
        icon: Icon(Icons.swap_horiz),
        onPressed: () {
          setState(() {
            switchContent = !switchContent;
          });
        },
      ),
    );
  }
}
```
</details>

### Expected Results
#### Without having to specify/modify container height 
| Content 1 | Content 2 |
| --------------- | --------------- |
<img width="1552" alt="Screenshot 2021-01-12 at 7 02 32 PM" src="https://user-images.githubusercontent.com/48603081/104321183-4c69c980-5509-11eb-8c52-c801ab233fb9.png"> | <img width="1552" alt="Screenshot 2021-01-12 at 7 03 02 PM" src="https://user-images.githubusercontent.com/48603081/104321264-686d6b00-5509-11eb-8d24-556e395355fb.png">


### Actual Results
#### If the container height is `500`
| Content 1 | Content 2 |
| --------------- | --------------- |
<img width="1552" alt="Screenshot 2021-01-12 at 7 02 32 PM" src="https://user-images.githubusercontent.com/48603081/104321458-a2d70800-5509-11eb-853a-02c18552a155.png"> | <img width="1552" alt="Screenshot 2021-01-12 at 7 02 43 PM" src="https://user-images.githubusercontent.com/48603081/104321491-b08c8d80-5509-11eb-9d22-61a9aaf7d7d1.png">
#### If the container height is `200`
| Content 1 | Content 2 |
| --------------- | --------------- |
<img width="1552" alt="Screenshot 2021-01-12 at 7 03 11 PM" src="https://user-images.githubusercontent.com/48603081/104321541-c306c700-5509-11eb-95a5-1f92ef669ffe.png"> | <img width="1552" alt="Screenshot 2021-01-12 at 7 03 02 PM" src="https://user-images.githubusercontent.com/48603081/104321560-cdc15c00-5509-11eb-9048-6b73edee23f0.png">

Note:
If the fixed height is omitted, there is no layout rendered (WAD)


<details>
<summary>flutter doctor -v</summary>

```bash
[✓] Flutter (Channel stable, 1.22.5, on macOS 11.1 20C69 darwin-x64, locale en-GB)
    • Flutter version 1.22.5 at /Users/tahatesser/Code/flutter_stable
    • Framework revision 7891006299 (5 weeks ago), 2020-12-10 11:54:40 -0800
    • Engine revision ae90085a84
    • Dart version 2.10.4

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Volumes/Extreme/SDK
    • Platform android-30, build-tools 30.0.3
    • ANDROID_HOME = /Volumes/Extreme/SDK
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.3)
    • Xcode at /Volumes/Extreme/Xcode.app/Contents/Developer
    • Xcode 12.3, Build version 12C33
    • CocoaPods version 1.10.1

[!] Android Studio (version 4.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)

[✓] VS Code (version 1.52.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.18.1

[✓] Connected device (2 available)
    • Android SDK built for x86 (mobile) • emulator-5554             • android-x86 • Android 10 (API 29) (emulator)
    • Taha’s iPad (mobile)               • 00008020-000255113EE8402E • ios         • iOS 14.3

! Doctor found issues in 1 category.
```
```bash
[✓] Flutter (Channel beta, 1.25.0-8.2.pre, on macOS 11.1 20C69 darwin-x64, locale en-GB)
    • Flutter version 1.25.0-8.2.pre at /Users/tahatesser/Code/flutter_beta
    • Framework revision b0a2299859 (7 days ago), 2021-01-05 12:34:13 -0800
    • Engine revision 92ae191c17
    • Dart version 2.12.0 (build 2.12.0-133.2.beta)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Volumes/Extreme/SDK
    • Platform android-30, build-tools 30.0.3
    • ANDROID_HOME = /Volumes/Extreme/SDK
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.3)
    • Xcode at /Volumes/Extreme/Xcode.app/Contents/Developer
    • Xcode 12.3, Build version 12C33
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • 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-b3-6915495)

[✓] VS Code (version 1.52.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.18.1

[✓] Connected device (3 available)
    • Android SDK built for x86 (mobile) • emulator-5554             • android-x86    • Android 10 (API 29) (emulator)
    • Taha’s iPad (mobile)               • 00008020-000255113EE8402E • ios            • iOS 14.3
    • Chrome (web)                       • chrome                    • web-javascript • Google Chrome 87.0.4280.141

• No issues found!
```
```bash
[✓] Flutter (Channel dev, 1.26.0-1.0.pre, on macOS 11.1 20C69 darwin-x64, locale en-GB)
    • Flutter version 1.26.0-1.0.pre at /Users/tahatesser/Code/flutter_dev
    • Framework revision 63062a6443 (4 weeks ago), 2020-12-13 23:19:13 +0800
    • Engine revision 4797b06652
    • Dart version 2.12.0 (build 2.12.0-141.0.dev)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Volumes/Extreme/SDK
    • Platform android-30, build-tools 30.0.3
    • ANDROID_HOME = /Volumes/Extreme/SDK
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.3)
    • Xcode at /Volumes/Extreme/Xcode.app/Contents/Developer
    • Xcode 12.3, Build version 12C33
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • 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-b3-6915495)

[✓] VS Code (version 1.52.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.18.1

[✓] Connected device (4 available)
    • Android SDK built for x86 (mobile) • emulator-5554             • android-x86    • Android 10 (API 29) (emulator)
    • Taha’s iPad (mobile)               • 00008020-000255113EE8402E • ios            • iOS 14.3
    • macOS (desktop)                    • macos                     • darwin-x64     • macOS 11.1 20C69 darwin-x64
    • Chrome (web)                       • chrome                    • web-javascript • Google Chrome 87.0.4280.141

• No issues found!
```
```bash
[✓] Flutter (Channel master, 1.26.0-2.0.pre.296, on macOS 11.1 20C69 darwin-x64, locale en-GB)
    • Flutter version 1.26.0-2.0.pre.296 at /Users/tahatesser/Code/flutter_master
    • Framework revision 737496e8db (6 hours ago), 2021-01-12 02:54:03 -0500
    • Engine revision 10cee6abcb
    • Dart version 2.12.0 (build 2.12.0-214.0.dev)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Volumes/Extreme/SDK
    • Platform android-30, build-tools 30.0.3
    • ANDROID_HOME = /Volumes/Extreme/SDK
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.3)
    • Xcode at /Volumes/Extreme/Xcode.app/Contents/Developer
    • Xcode 12.3, Build version 12C33
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • 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-b3-6915495)

[✓] VS Code (version 1.52.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.18.1

[✓] Connected device (4 available)
    • Android SDK built for x86 (mobile) • emulator-5554             • android-x86    • Android 10 (API 29) (emulator)
    • Taha’s iPad (mobile)               • 00008020-000255113EE8402E • ios            • iOS 14.3
    • macOS (desktop)                    • macos                     • darwin-x64     • macOS 11.1 20C69 darwin-x64
    • Chrome (web)                       • chrome                    • web-javascript • Google Chrome 87.0.4280.141

• No issues found!
```

</details>



Thank you