Skip to content

Conversation

@KalilDev
Copy link
Contributor

@KalilDev KalilDev commented Dec 16, 2019

Description

Documentation states the trailingIcon 'Will be colored in the same way as the [TextStyle] used for [child]', but it was using destructiveRed unconditionally as of now. This pull request fixes this behavior.

Also added tests for both regular and destructive colors, and for the default textStyle weight, to ensure there isn't an regression leading to this again in the future.

Before (Broken) -> After (Fixed)

Related Issues

#47150

Tests

I added the following tests:

packages/flutter/lib/cupertino/context_menu_action.dart:

  • icon and textStyle colors are right out of the box
  • icon and textStyle colors are right for destructive actions
  • textStyle is right for defaultAction

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Did any tests fail when you ran them? Please read Handling breaking changes.

  • No, no existing tests failed, so this is not a breaking change.
  • Yes, this is a breaking change.

* Documentation states the trailingIcon 'Will be colored in the same way as the [TextStyle] used for [child]', but it was using destructiveRed unconditionally.
* Also add tests for both regular and destructive colors, and for the default textStyle weight.
@fluttergithubbot fluttergithubbot added f: cupertino flutter/packages/flutter/cupertino repository framework flutter/packages/flutter repository. See also f: labels. labels Dec 16, 2019
Copy link
Contributor

@justinmc justinmc left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Thanks for catching this bug! I think the test failures are flakes. I'll try to fix them.

@justinmc justinmc merged commit b39ebcb into flutter:master Dec 18, 2019
@KalilDev KalilDev deleted the fix-cupertino-context-menu-action-colors branch December 19, 2019 17:24
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

f: cupertino flutter/packages/flutter/cupertino repository framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants