Repository: flutter
Issue: Gradient sometimes doesn't extend to the edges of the widget
Labels: platform-android,framework,engine,c: rendering,has reproducible steps,P2,found in release: 2.10,found in release: 2.13,team-android,triaged-android

At certain widget sizes, the `BoxDecoration`'s gradient doesn't affect the last 1-2 pixels of the edges. If you zoom on the 2 images I've uploaded below, you will see that the gradient doesn't reach the end of any of the sides. If in the example code I set the `SizedBox`'s height to 400, while leaving the width at 300, only the left and right sides won't be reached.
The pattern I've noticed is: when the height is set to {100, 300, 500...} the gradient doesn't extend completely vertically and with {200, 400, 600...} it does. The width affects the horizontal axis the same way.

<details>
<summary>Images</summary>

<img width=45% src=https://user-images.githubusercontent.com/35681808/164038451-3371f03a-fbc2-4195-9673-09c88bca1c1a.png> <img width=45% src=https://user-images.githubusercontent.com/35681808/164038490-41f8ced5-02a9-45bd-8b45-7e977c898959.png>

</details>

<details>
<summary>Code to reproduce</summary>

```dart
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 MaterialApp(
      home: Scaffold(
        backgroundColor: Colors.black,
        body: Center(
          child: SizedBox(
            width: 300,
            height: 300,
            child: DecoratedBox(
              decoration: const BoxDecoration(color: Colors.pink),
              child: DecoratedBox(
                decoration: BoxDecoration(
                  gradient: LinearGradient(
                    begin: Alignment.centerRight,
                    end: Alignment.centerLeft,
                    stops: const [0, 0.2, 0.3],
                    colors: [
                      Colors.black,
                      Colors.black.withAlpha(150),
                      Colors.black.withAlpha(0),
                    ],
                  ),
                ),
              ),
            ),
          ),
        ),
      ),
    );
  }
}
```
</details>

<details>
<summary>flutter doctor -v</summary>

```
[√] Flutter (Channel stable, 2.10.5, on Microsoft Windows [Version 10.0.19044.1645], locale en-US)
    • Flutter version 2.10.5 at C:\Dev\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 5464c5bac7 (22 hours ago), 2022-04-18 09:55:37 -0700
    • Engine revision 57d3bac3dd
    • Dart version 2.16.2
    • DevTools version 2.9.2

[√] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc1)
    • Android SDK at D:\Programs\Android_SDK
    • Platform android-31, build-tools 33.0.0-rc1
    • Java binary at: D:\Programs\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.11+9-b60-7590822)
    • All Android licenses accepted.

[X] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[X] Visual Studio - develop for Windows
    X Visual Studio not installed; this is necessary for Windows development.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components

[√] Android Studio (version 2021.1)
    • Android Studio at D:\Programs\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 11.0.11+9-b60-7590822)

[√] VS Code (version 1.66.2)
    • VS Code at C:\Users\hrist\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.38.1

[√] Connected device (3 available)
    • sdk gphone x86 (mobile) • emulator-5554 • android-x86    • Android 11 (API 30) (emulator)
    • Windows (desktop)       • windows       • windows-x64    • Microsoft Windows [Version 10.0.19044.1645]
    • Edge (web)              • edge          • web-javascript • Microsoft Edge 100.0.1185.44

[√] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 2 categories.
```
</details>

<details>
<summary>flutter analyze</summary>

```                                            
No issues found!
```
</details>