Repository: flutter
Issue: ShapeDecoration lerp from gradient to color assert error
Labels: c: crash,framework,a: error message,has reproducible steps,P2,found in release: 2.5,found in release: 2.6,team-framework,triaged-framework

Hi, I faced with a problem of animated transition between `ShapeDecoration` with color and `ShapeDecoration` with gradient. I also noted that there is no such problem for `BoxDecoration`.

### Steps to Reproduce

<!-- Please include full steps to reproduce so that we can reproduce the problem. -->

1. Execute `flutter run` on the code sample <!-- (see "Code sample" section below) -->

**Expected results:** Animated transition from gradient to color

**Actual results:** Gradient -> error during transition -> color.

<details>
<summary>Code sample</summary>

```dart
import 'package:flutter/material.dart';

void main() {
  runApp(App());
}

class App extends StatelessWidget {
  App({Key? key}) : super(key: key);

  final Decoration _decorationGradient = ShapeDecoration(
      gradient: LinearGradient(colors: [
        Colors.blue,
        Colors.blue.shade800,
      ]),
      shape: RoundedRectangleBorder());

  final Decoration _decorationColor = ShapeDecoration(
    color: Colors.white,
    shape: RoundedRectangleBorder(),
  );

  @override
  Widget build(BuildContext context) {
    return TweenAnimationBuilder<Decoration>(
      tween: DecorationTween(begin: _decorationGradient, end: _decorationColor),
      duration: Duration(seconds: 3),
      builder: (context, value, _) {
        return Container(decoration: value);
      },
    );
  }
}

```

</details>

<details>
  <summary>Logs</summary>

```
══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
The following assertion was thrown building TweenAnimationBuilder<Decoration>(duration: 3000ms,
dirty, state: _TweenAnimationBuilderState<Decoration>#0cfd8(ticker active)):
'package:flutter/src/painting/shape_decoration.dart': Failed assertion: line 80 pos 15: '!(color !=
null && gradient != null)': is not true.
```

<!-- Finally, paste the output of running `flutter doctor -v` here. -->

```
flutter doctor -v
[✓] Flutter (Channel stable, 2.5.1, on macOS 11.5.1 20G80 darwin-x64, locale en-BY)
    • Flutter version 2.5.1 at /Users/Aliaksei_Katsura/fvm/versions/2.5.1
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ffb2ecea52 (9 weeks ago), 2021-09-17 15:26:33 -0400
    • Engine revision b3af521a05
    • Dart version 2.14.2

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/Aliaksei_Katsura/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
    • All Android licenses accepted.

[!] 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)

[✓] Connected device (3 available)
    • Android SDK built for x86 (mobile) • emulator-5554 • android-x86    • Android 11 (API 30) (emulator)
    • macOS (desktop)                    • macos         • darwin-x64     • macOS 11.5.1 20G80 darwin-x64
    • Chrome (web)                       • chrome        • web-javascript • Google Chrome 95.0.4638.69

! Doctor found issues in 1 category.

```

</details>