flutteractionsbot 2ac7536e53
[CP-stable]Enhance ColorScheme.fromSeed with a new variant parameter (#148916)
This pull request is created by [automatic cherry pick workflow](https://github.com/flutter/flutter/wiki/Flutter-Cherrypick-Process#automatically-creates-a-cherry-pick-request)
Please fill in the form below, and a flutter domain expert will evaluate this cherry pick request.

### Issue Link:
What is the link to the issue this cherry-pick is addressing?

https://github.com/flutter/flutter/issues/148359

### Changelog Description:
Explain this cherry pick in one line that is accessible to most Flutter developers. See [best practices](https://github.com/flutter/flutter/wiki/Hotfix-Documentation-Best-Practices) for examples

Provide an option in `ColorScheme.fromSeed` method to respect the seed color even if the seed color is very bright.

### Impact Description:
What is the impact (ex. visual jank on Samsung phones, app crash, cannot ship an iOS app)? Does it impact development (ex. flutter doctor crashes when Android Studio is installed), or the shipping production app (the app crashes on launch)

The updated algorithm in `ColorScheme.fromSeed` creates a darker version of `ColorScheme`. This may result in apps looking different from their original color theme.

### Workaround:
Is there a workaround for this issue?

Manually construct a desired `ColorScheme` instead of using `ColorScheme.fromSeed`, or use the deprecated `Scheme` class in [MCU package](https://github.com/material-foundation/material-color-utilities/blob/main/dart/lib/scheme/scheme.dart) to build the `ColorScheme`

### Risk:
What is the risk level of this cherry-pick?

This cherry-pick does not break the current implementation but only provides an option if users want the `ColorScheme` built by `ColorScheme.fromSeed` respect the seed color.

### Test Coverage:
Are you confident that your fix is well-tested by automated tests?

### Validation Steps:
What are the steps to validate that this fix works?

With `dynamicSchemeVariant: DynamicSchemeVariant.fidelity`, the color scheme constructed by `ColorScheme.fromSeed()` respects the seed color.
2024-06-04 18:34:06 +00:00
..
…

Flutter Examples

This directory contains several examples of using Flutter. To run an example, use flutter run inside that example's directory. See the getting started guide to install the flutter tool.

For additional samples, see the flutter/samples repo.

Available examples include:

Notes

Note on Gradle wrapper files in .gitignore:

Gradle wrapper files should normally be checked into source control. The example projects don't do that to avoid having several copies of the wrapper binary in the Flutter repo. Instead, the Gradle wrapper is injected by Flutter tooling, and the wrapper files are .gitignore'd to avoid making the Flutter repository dirty as a side effect of running the examples.