Repository: flutter
Issue: Ink in ListView overflowing
Labels: framework,f: scrolling,a: layout,has reproducible steps,P2,found in release: 2.2,found in release: 2.5,team-framework,triaged-framework

## Steps to Reproduce

<!-- You must include full steps to reproduce so that we can reproduce the problem. -->

1. Run `flutter create bug`.
2. Update the `main.dart`

<details>
  <summary>Main</summary>

```dart
import 'dart:math';
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(home: Home());
  }
}

class Home extends StatelessWidget {
  const Home({Key? key}) : super(key: key);

  static const _colors = [
    Colors.green, 
    Colors.red,
    Colors.amber,
    Colors.blue,
    Colors.teal,
    Colors.pink,
  ];

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Container(
        constraints: const BoxConstraints(maxWidth: 678),
        child: SizedBox(
          height: 240,
          width: double.maxFinite,
          child: ListView.builder(
            scrollDirection: Axis.horizontal,
            // To render all the boxes not supposed to be in view
            cacheExtent: double.maxFinite,
            itemCount: 20,
            itemBuilder: (context, i) => Container(
              padding: const EdgeInsets.all(20),
              child: InkWell(
                borderRadius: BorderRadius.circular(16),
                onTap: () {},
                child: Ink(
                  decoration: BoxDecoration(
                    borderRadius: BorderRadius.circular(16),
                    color: _colors[Random().nextInt(_colors.length)],
                  ),
                  height: double.maxFinite,
                  width: 240,
                  child: const Align(
                    alignment: Alignment.bottomLeft,
                    child: Padding(
                      padding: EdgeInsets.all(8),
                      child: Chip(
                        backgroundColor: Colors.white,
                        label: Text("Watch the text being cut off"),
                      ),
                    ),
                  ),
                ),
              ),
            ),
          ),
        ),
      ),
    );
  }
}
```

</details>

**Expected results:** 
<img width="1524" alt="Expected" src="https://user-images.githubusercontent.com/36016925/130653509-bd3f2285-bb3c-4efd-ad3e-68e028804556.png">

**Actual results:** 

<img width="1524" alt="Actual" src="https://user-images.githubusercontent.com/36016925/130653249-0181e57d-f97e-4da5-9284-0008b2ee441c.png">



<details>
  <summary>Logs</summary>

```zsh
[  +92 ms] executing: sysctl hw.optional.arm64
[  +17 ms] Exit code 1 from: sysctl hw.optional.arm64
[        ] sysctl: unknown oid 'hw.optional.arm64'
[   +9 ms] executing: [/Users/user/Repos/flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[  +11 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[        ] 6dc18ef74e2f814c252ef71632b06d3e6e03ca12
[   +1 ms] executing: [/Users/user/Repos/flutter/] git tag --points-at 6dc18ef74e2f814c252ef71632b06d3e6e03ca12
[  +21 ms] Exit code 0 from: git tag --points-at 6dc18ef74e2f814c252ef71632b06d3e6e03ca12
[   +1 ms] executing: [/Users/user/Repos/flutter/] git describe --match *.*.* --long --tags 6dc18ef74e2f814c252ef71632b06d3e6e03ca12
[  +44 ms] Exit code 0 from: git describe --match *.*.* --long --tags 6dc18ef74e2f814c252ef71632b06d3e6e03ca12
[        ] 2.5.0-6.0.pre-213-g6dc18ef74e
[  +10 ms] executing: [/Users/user/Repos/flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[  +10 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[        ] origin/master
[        ] executing: [/Users/user/Repos/flutter/] git ls-remote --get-url origin
[   +9 ms] Exit code 0 from: git ls-remote --get-url origin
[        ] https://github.com/flutter/flutter.git
[  +84 ms] Unable to locate an Android SDK.
[   +6 ms] executing: [/Users/user/Repos/flutter/] git rev-parse --abbrev-ref HEAD
[  +10 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] master
[   +5 ms] executing: sw_vers -productName
[  +13 ms] Exit code 0 from: sw_vers -productName
[        ] macOS
[        ] executing: sw_vers -productVersion
[  +12 ms] Exit code 0 from: sw_vers -productVersion
[        ] 12.0
[        ] executing: sw_vers -buildVersion
[  +13 ms] Exit code 0 from: sw_vers -buildVersion
[        ] 21A5304g
[  +57 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[   +2 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[  +94 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[   +2 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[  +30 ms] executing: sysctl hw.optional.arm64
[   +4 ms] Exit code 1 from: sysctl hw.optional.arm64
[        ] sysctl: unknown oid 'hw.optional.arm64'
[        ] executing: xcrun xcodebuild -version
[   +7 ms] Exit code 72 from: xcrun xcodebuild -version
[        ] xcrun: error: unable to find utility "xcodebuild", not a developer tool or in PATH
[  +56 ms] Skipping pub get: version match.
[ +123 ms] Generating /Users/user/Repos/bug/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
[ +190 ms] Launching lib/main.dart on Chrome in debug mode...
[ +111 ms] Updating assets
[  +86 ms] Waiting for connection from debug service on Chrome...
[ +105 ms] <- reset
[   +7 ms] /Users/user/Repos/flutter/bin/cache/dart-sdk/bin/dart --disable-dart-dev /Users/user/Repos/flutter/bin/cache/artifacts/engine/darwin-x64/frontend_server.dart.snapshot --sdk-root
/Users/user/Repos/flutter/bin/cache/flutter_web_sdk/ --incremental --target=dartdevc --debugger-module-names --experimental-emit-debug-metadata -DFLUTTER_WEB_AUTO_DETECT=true --output-dill
/var/folders/0v/skvczvg56mjb600ncwx192t40000gp/T/flutter_tools.mhI9uO/flutter_tool.ZDM4d7/app.dill --libraries-spec file:///Users/user/Repos/flutter/bin/cache/flutter_web_sdk/libraries.json --packages
/Users/user/Repos/bug/.dart_tool/package_config.json -Ddart.vm.profile=false -Ddart.vm.product=false --enable-asserts --track-widget-creation --filesystem-root
/var/folders/0v/skvczvg56mjb600ncwx192t40000gp/T/flutter_tools.mhI9uO/flutter_tools.EAf7Ka --filesystem-scheme org-dartlang-app --initialize-from-dill
build/b1b715402d823b7fd5c2b68d2edcb2ce.cache.dill.track.dill --platform file:///Users/user/Repos/flutter/bin/cache/flutter_web_sdk/kernel/flutter_ddc_sdk_sound.dill --sound-null-safety
[  +16 ms] <- compile org-dartlang-app:/web_entrypoint.dart
[+14368 ms] Waiting for connection from debug service on Chrome... (completed in 14.5s)
[        ] Synced 26.3MB.
[        ] <- accept
[        ] Caching compiled dill
[  +70 ms] Using Google Chrome 92.0.4515.159 

[   +8 ms] executing: sysctl hw.optional.arm64
[   +6 ms] Exit code 1 from: sysctl hw.optional.arm64
[        ] sysctl: unknown oid 'hw.optional.arm64'
[ +325 ms] [CHROME]:
[        ] [CHROME]:DevTools listening on ws://127.0.0.1:54148/devtools/browser/5328318f-48ed-4a73-b021-8d2fd9d210f3
[ +925 ms] DwdsInjector: Received request for entrypoint at http://localhost:54141/main_module.bootstrap.js
[   +6 ms] MetadataProvider: Loading debug metadata...
[  +21 ms] MetadataProvider: Loaded debug metadata (sound null safety)
[  +12 ms] DwdsInjector: Injected debugging metadata for entrypoint at http://localhost:54141/main_module.bootstrap.js
[+1590 ms] ChromeProxyService: Initializing expression compiler for main_module.bootstrap.js with sound null safety: true
[  +82 ms] DevHandler: Debug service listening on ws://127.0.0.1:54167/AsnDPzyUhD4=/ws

[  +23 ms] This app is linked to the debug service: ws://127.0.0.1:54167/AsnDPzyUhD4=/ws
[  +11 ms] Debug service listening on ws://127.0.0.1:54167/AsnDPzyUhD4=/ws
[        ] 💪 Running with sound null safety 💪
[   +3 ms] 🔥  To hot restart changes while running, press "r" or "R".
[        ] For a more detailed help message, press "h". To quit, press "q".
[   +1 ms] An Observatory debugger and profiler on Chrome is available at: http://127.0.0.1:54167/AsnDPzyUhD4=
[ +456 ms] DevTools activation throttled until 2021-08-25 04:46:05.554088.
[+1920 ms] The Flutter DevTools debugger and profiler on Chrome is available at: http://127.0.0.1:9102?uri=http://127.0.0.1:54167/AsnDPzyUhD4=
```

<br />

```zsh
Analyzing bug...                                                        
No issues found! (ran in 1.2s)
```

<br />

```zsh
[✓] Flutter (Channel master, 2.5.0-7.0.pre.213, on macOS 12.0 21A5304g darwin-x64, locale en-GB)
    • Flutter version 2.5.0-7.0.pre.213 at /Users/user/Repos/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 6dc18ef74e (11 hours ago), 2021-08-24 11:09:04 +0530
    • Engine revision 926ce0d855
    • Dart version 2.15.0 (build 2.15.0-43.0.dev)

[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.


[!] Xcode - develop for iOS and macOS
    ✗ Xcode installation is incomplete; a full installation is necessary for iOS development.
      Download at: https://developer.apple.com/xcode/download/
      Or install Xcode via the App Store.
      Once installed, run:
        sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
        sudo xcodebuild -runFirstLaunch
    • CocoaPods version 1.10.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2020.3)
    • 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 11.0.10+0-b96-7281165)

[✓] VS Code (version 1.59.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.25.0

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-x64     • macOS 12.0 21A5304g darwin-x64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 92.0.4515.159

! Doctor found issues in 2 categories.
```

</details>