Skip to content

Conversation

@flutteractionsbot
Copy link

@flutteractionsbot flutteractionsbot commented May 22, 2024

This pull request is created by automatic cherry pick workflow
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?

#148359

Changelog Description:

Explain this cherry pick in one line that is accessible to most Flutter developers. See 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 to build the ColorScheme

Risk:

What is the risk level of this cherry-pick?

  • Low
  • Medium
  • High

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?

  • Yes
  • No

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.

…144805)

Fixes flutter#144649

This PR is to add an enhancement for `ColorScheme.fromSeed()`.  When we input a brighter color with a high chroma and we want the resulting `ColorScheme` respects the source color, we can achieve this by setting

```dart
ColorScheme.fromSeed(
  seedColor: sourceColor,
  variant: Variant.fidelity,
  ...
)
```

Here is a demo for `ColorScheme` constructed by all 9 variants:
![Screenshot 2024-03-13 at 4 33 02�PM](https://github.com/flutter/flutter/assets/36861262/2cdbe559-67ff-4f8b-bd48-ccff5131b949)
![Screenshot 2024-03-13 at 4 33 07�PM](https://github.com/flutter/flutter/assets/36861262/e6af2362-c501-499b-8880-06a321de91e6)
@flutteractionsbot flutteractionsbot added the cp: review Cherry-picks in the review queue label May 22, 2024
@flutteractionsbot
Copy link
Author

@QuncCccccc please fill out the PR description above, afterwards the release team will review this request.

@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos labels May 22, 2024
Copy link
Member

@goderbauer goderbauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@itsjustkevin
Copy link
Contributor

@QuncCccccc @goderbauer @Piinks while i do understand that we made a complete mistake in communicating this change to users, this cherry-pick seems to be cherry-picking an entire feature into the release branch, which we do not typically accept.

Due to the miscommunication around the fix timeline, I am inclined to accept this either way.

@Piinks
Copy link
Contributor

Piinks commented Jun 4, 2024

My understanding is that this fixes a breaking change that was accidentally made in the latest release. A change to color scheme landed, a while later we got feedback it broke some things. This fix made the breaking change backwards compatible, and we wrote a migration guide, thinking that this follow up change made the release cut, when it actually just missed it.
This has affected a lot of folks, so I support this CP so they will not have to wait on the next release. Several comments have been made to that effect on the issue.

@itsjustkevin itsjustkevin added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 4, 2024
@auto-submit auto-submit bot merged commit 2ac7536 into flutter:flutter-3.22-candidate.0 Jun 4, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App cp: approved Approved cherry-pick request cp: review Cherry-picks in the review queue d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants