Repository: flutter
Issue: Ink widget decoration visible or/and renders outside the ListView boundary up to the cacheExtent.
Labels: framework,f: material design,f: scrolling,has reproducible steps,P2,found in release: 3.3,found in release: 3.7,team-design,triaged-design

<!-- Thank you for using Flutter!

     If you are looking for support, please check out our documentation
     or consider asking a question on Stack Overflow:
      * https://flutter.dev/
      * https://api.flutter.dev/
      * https://stackoverflow.com/questions/tagged/flutter?sort=frequent

     If you have found a bug or if our documentation doesn't have an answer
     to what you're looking for, then fill out the template below. Please read
     our guide to filing a bug first: https://flutter.dev/docs/resources/bug-reports
-->

## Steps to Reproduce

<!-- You must include full steps to reproduce so that we can reproduce the problem. -->

1. A reproducible app is available in the following [dartpad](https://dartpad.dev/609b2ee7d6a5b3bf8cecac9f1f833b17?) with the following code.
``` 
import 'package:flutter/material.dart';

final Color darkBlue = Color.fromARGB(255, 18, 32, 47);

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData.dark().copyWith(scaffoldBackgroundColor: darkBlue),
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        body: Center(
          child: MyWidget(),
        ),
      ),
    );
  }
}

class MyWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Container(
      height: 300,
      width: 100,
      // Just to show the boundary of the listview.
      decoration: BoxDecoration(
        border: Border.all(
          color: Colors.white,
          width: 5,
        ),
      ),
      child: ListView(
        // switching cache extent to 0 stop this.
        // cacheExtent: 0,
        children: List<int>.generate(50, (x) => x)
            .map((y) => Ink(
                  decoration: BoxDecoration(
                    color: Colors.pink,
                    border: Border(
                      bottom: BorderSide(color: Colors.green),
                    ),
                  ),
                  child: InkWell(
                    splashColor: Colors.green,
                    child: Icon(
                      Icons.plus_one,
                      size: 22,
                    ),
                    onTap: () {},
                  ),
                ))
            .toList(),
      ),
    );
  }
}

````

3. When an `Ink` widget is used inside a `ListView` its decoration is still being rendered outside the boundary of the `ListView`'s visible area i.e. upto the cache extent. I am not really sure if this is an issue or expected behavior. However felt like it should be intimated and recorded. The documentation of Ink widget says the following.

>This widget is subject to the same limitations as other ink effects, as described in the documentation for Material. Most notably, the position of an **_Ink widget must not change during the lifetime of the Material object unless a LayoutChangedNotification is dispatched each frame that the position changes. This is done automatically for ListView and other scrolling widgets,_** but is not done for animated transitions such as SlideTransition.

A similar issue of Ink widget inside ListView is recorded as #68194.  However it defines the issue as being jut buggy and I am not sure if its related.

**Expected results:** 
I expect that the decoration especially the background color of the `Ink` widget is not visible beyond the `ListView` boundary.

**Actual results:** 
The decoration on the `Ink` widget is visible outside the boundary of the `ListView` marked in white color in the below video.

https://user-images.githubusercontent.com/4489849/103637027-23669900-4f4b-11eb-8097-59b6a5fec4b2.mp4

<details>
  <summary>Logs</summary>

C:\Abhilash\Github\ink_widget_issue>flutter run -d chrome --verbose
[ +123 ms] executing: [C:\Abhilash\Sources\flutter/]
git -c log.showSignature=false log -n 1
--pretty=format:%H
[ +136 ms] Exit code 0 from: git -c
log.showSignature=false log -n 1 --pretty=format:%H
[   +1 ms] 6c1a29e54c412d244256d9a23e7c1f0a76e2f0e1 
[        ] executing: [C:\Abhilash\Sources\flutter/]
git tag --points-at HEAD
[ +131 ms] Exit code 0 from: git tag --points-at HEAD
[   +2 ms] executing: [C:\Abhilash\Sources\flutter/]   
git describe --match *.*.* --first-parent --long --tags[ +212 ms] Exit code 0 from: git describe --match *.*.*--first-parent --long --tags
[   +4 ms] 1.22.0-9.0.pre-121-g6c1a29e54c
[  +10 ms] executing: [C:\Abhilash\Sources\flutter/]
git rev-parse --abbrev-ref --symbolic @{u}
[ +112 ms] Exit code 0 from: git rev-parse --abbrev-ref--symbolic @{u}
[   +1 ms] origin/master
[        ] executing: [C:\Abhilash\Sources\flutter/]   
git ls-remote --get-url origin
[ +107 ms] Exit code 0 from: git ls-remote --get-url
origin
[        ] https://github.com/flutter/flutter.git
[ +139 ms] executing: [C:\Abhilash\Sources\flutter/]
git rev-parse --abbrev-ref HEAD
[ +147 ms] Exit code 0 from: git rev-parse --abbrev-refHEAD
[  +10 ms] master
[  +80 ms] Artifact Instance of 'AndroidMavenArtifacts'is not required, skipping update.
[   +1 ms] Artifact Instance of
'AndroidGenSnapshotArtifacts' is not required, skippingupdate.
[   +2 ms] Artifact Instance of
'AndroidInternalBuildArtifacts' is not required,       
skipping update.
[   +2 ms] Artifact Instance of 'IOSEngineArtifacts' isnot required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not 
required, skipping update.
[   +5 ms] Artifact Instance of
'WindowsEngineArtifacts' is not required, skipping     
update.
[   +1 ms] Artifact Instance of 'MacOSEngineArtifacts' 
is not required, skipping update.
[   +9 ms] Artifact Instance of 'LinuxEngineArtifacts'
is not required, skipping update.
[   +3 ms] Artifact Instance of
'LinuxFuchsiaSDKArtifacts' is not required, skipping   
update.
[   +2 ms] Artifact Instance of
'MacOSFuchsiaSDKArtifacts' is not required, skipping   
update.
[  +15 ms] Artifact Instance of
'FlutterRunnerSDKArtifacts' is not required, skipping  
update.
[   +3 ms] Artifact Instance of
'FlutterRunnerDebugSymbols' is not required, skipping  
update.
[  +35 ms] executing:
C:\Users\abhi\AppData\Local\Android\sdk\platform-tools\adb.exe devices -l
[ +103 ms] List of devices attached
[  +11 ms] Artifact Instance of 'AndroidMavenArtifacts'is not required, skipping update.
[   +1 ms] Artifact Instance of
'AndroidGenSnapshotArtifacts' is not required, skippingupdate.
[   +2 ms] Artifact Instance of
'AndroidInternalBuildArtifacts' is not required,       
skipping update.
[   +3 ms] Artifact Instance of 'IOSEngineArtifacts' isnot required, skipping update.
[   +5 ms] Artifact Instance of
'WindowsEngineArtifacts' is not required, skipping     
update.
[   +1 ms] Artifact Instance of 'MacOSEngineArtifacts' 
is not required, skipping update.
[   +9 ms] Artifact Instance of 'LinuxEngineArtifacts'
is not required, skipping update.
[   +3 ms] Artifact Instance of
'LinuxFuchsiaSDKArtifacts' is not required, skipping   
update.
[   +2 ms] Artifact Instance of
'MacOSFuchsiaSDKArtifacts' is not required, skipping   
update.
[   +3 ms] Artifact Instance of
'FlutterRunnerSDKArtifacts' is not required, skipping  
update.
[  +11 ms] Artifact Instance of
'FlutterRunnerDebugSymbols' is not required, skipping  
update.
[ +213 ms] Generating
C:\Abhilash\Github\ink_widget_issue\android\app\src\main\java\io\flutter\plugins\GeneratedPluginRegistrant.java
[ +135 ms] Launching lib\main.dart on Chrome in debug
mode...
[  +98 ms] Updating assets
[ +113 ms] Syncing files to device Chrome...
[ +102 ms] Generating
C:\Abhilash\Github\ink_widget_issue\android\app\src\main\java\io\flutter\plugins\GeneratedPluginRegistrant.java
[  +72 ms] <- reset
[   +8 ms]
C:\Abhilash\Sources\flutter\bin\cache\dart-sdk\bin\dart.exe --disable-dart-dev
C:\Abhilash\Sources\flutter\bin\cache\artifacts\engine\windows-x64\frontend_server.dart.snapshot --sdk-root
C:\Abhilash\Sources\flutter\bin\cache\flutter_web_sdk/
--incremental --target=dartdevc --debugger-module-names--experimental-emit-debug-metadata
-Ddart.developer.causal_async_stacks=true --output-dillC:\Users\abhi\AppData\Local\Temp\flutter_tools.c93eae8b\flutter_tool.29550606\app.dill --libraries-spec
file:///C:/Abhilash/Sources/flutter/bin/cache/flutter_web_sdk/libraries.json --packages .packages
-Ddart.vm.profile=false -Ddart.vm.product=false
--bytecode-options=source-positions,local-var-info,debugger-stops,instance-field-initializers,keep-unreachable-code,avoid-closure-call-instructions --enable-asserts
--track-widget-creation --filesystem-root
C:\Users\abhi\AppData\Local\Temp\flutter_tools.c93eae8b\flutter_tools.301f550e --filesystem-scheme
org-dartlang-app --initialize-from-dill
build\cache.dill.track.dill --platform
file:///C:/Abhilash/Sources/flutter/bin/cache/flutter_web_sdk/kernel/flutter_ddc_sdk.dill
[ +174 ms] <- compile
org-dartlang-app:/web_entrypoint.dart
[+8909 ms] Syncing files to device Chrome... (completed in 9.256ms, longer than expected)
[   +1 ms] Synced 26.5MB.
[   +1 ms] <- accept
[        ] Caching compiled dill
[ +390 ms] [CHROME]:
[   +2 ms] [CHROME]:DevTools listening on ws://127.0.0.1:61542/devtools/browser/59b88d6e-a547-4d16-b712-5399fbbabd2d
[+8369 ms] Debug service listening on ws://127.0.0.1:61577/KNQY6AxyoRw=

[ +238 ms] Debug service listening on ws://127.0.0.1:61577/KNQY6AxyoRw=
[   +2 ms] Warning: Flutter's support for web development is not stable yet and hasn't
[  +67 ms] been thoroughly tested in production environments.
[  +13 ms] For more information see https://flutter.dev/web
[   +3 ms]   To hot restart changes while running, press "r" or "R".
[   +3 ms] For a more detailed help message, press "h". To quit, press "q".
[+12244 ms] Stopped debug service on ws://127.0.0.1:61577

[ +210 ms] Application finished.
[   +1 ms] "flutter run" took 31.638ms.
[ +126 ms] ensureAnalyticsSent: 121ms
[   +9 ms] Running shutdown hooks
[   +2 ms] Shutdown hook priority 4
[ +240 ms] Shutdown hooks complete
[   +1 ms] exiting with code 0

```
```

C:\Abhilash\Github\ink_widget_issue>flutter analyze
Analyzing ink_widget_issue...
No issues found! (ran in 1.7s)

```
```
[√] Flutter (Channel master, 1.22.0-10.0.pre.121, on Microsoft Windows [Version
    10.0.18363.1256], locale de-DE)
    • Flutter version 1.22.0-10.0.pre.121 at C:\Abhilash\Sources\flutter
    • Framework revision 6c1a29e54c (4 months ago), 2020-09-09 20:05:05 -0400
    • Engine revision 564367b297
    • Dart version 2.10.0 (build 2.10.0-107.0.dev)


[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)       
    • Android SDK at C:\Users\nxf54687\AppData\Local\Android\sdk
    • Platform android-29, build-tools 29.0.3
    • Java binary at: C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe
    • Java version Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.7.6)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.7.30611.23
    • Windows 10 SDK version 10.0.17763.0

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).       

[√] VS Code (version 1.52.1)
    • VS Code at C:\Users\nxf54687\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.18.0

[√] Connected device (3 available)
    • Windows (desktop) • windows    • windows-x64    • Microsoft Windows [Version 10.0.18363.1256]
    • Web Server (web)  • web-server • web-javascript • Flutter Tools
    • Chrome (web)      • chrome     • web-javascript • Google Chrome 87.0.4280.88

! Doctor found issues in 1 category.

```
```

</details>