Skip to content

Conversation

@KagurazakaHanabi
Copy link
Contributor

@KagurazakaHanabi KagurazakaHanabi commented Nov 16, 2019

Description

Before: we can't change the trailing icon color and size

Related Issues

Closes #44567

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 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.

@fluttergithubbot fluttergithubbot added f: cupertino flutter/packages/flutter/cupertino repository framework flutter/packages/flutter repository. See also f: labels. labels Nov 16, 2019
@fluttergithubbot
Copy link
Contributor

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@HansMuller HansMuller requested a review from justinmc November 22, 2019 19:17
@justinmc
Copy link
Contributor

@KagurazakaHanabi Thanks for the PR and so sorry for taking so long to review! I agree with this idea, but this would be a breaking change, which Flutter tries to avoid as much as possible.

I'm going to think about how we want to enable this kind of customization...

By the way, if we do move forward with this PR, we'll need some tests.

@justinmc
Copy link
Contributor

Also heads up that the isDestructiveAction parameter wasn't working, but after this PR it will be able to be used to turn the action red: #47151

See also isDefaultAction.

@KagurazakaHanabi
Copy link
Contributor Author

KagurazakaHanabi commented Dec 18, 2019

But I think if it is Widget trailing, it will be more flexible, such as use another Widget as icon. I can continue after #47151 is merged.

@justinmc
Copy link
Contributor

Sounds good. Yeah I agree that it's more flexible as a widget.

…bi-patch-2

# Conflicts:
#	packages/flutter/lib/src/cupertino/context_menu_action.dart
@KalilDev
Copy link
Contributor

KalilDev commented Dec 18, 2019

Hey, I just saw this, and I think there is a good way to add this customization. Just like Container.color in fact sets an BoxDecoration with this color, trailingIcon can set trailing to be an Icon(trailingIcon) and asserted that either it or trailing is null. This way it won't be a breaking change as trailingIcon will still be available and it can be marked as deprecated, and instructions to migrate can be added to the trailing member documentation.

@justinmc
Copy link
Contributor

That's not a bad idea. So there would be both trailing and trailingIcon. @KagurazakaHanabi What do you think?

@KagurazakaHanabi
Copy link
Contributor Author

@justinmc My idea is delete "trailingIcon" directly without considering compatibility, because moving from "trailingIcon" to "trailing" is easy

Copy link
Contributor

@Piinks Piinks left a comment

Choose a reason for hiding this comment

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

Hi @KagurazakaHanabi thank you for the contribution, and apologies for the delayed review! As this is right now, it would be a very large breaking change. I've linked the guide for handling those below.

return _kActionSheetActionStyle;
}


Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Unnecessary white space

await tester.pumpWidget(_getApp(isDefaultAction: true));
expect(_getTextStyle(tester).fontWeight, _kDefaultActionWeight);
});

Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Unnecessary white space

Copy link
Contributor

@Piinks Piinks left a comment

Choose a reason for hiding this comment

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

Hi @KagurazakaHanabi thanks for checking out the breaking change policy! It also specifies that a design document will need to be created first to discuss the proposed change and receive feedback. The policy has a design doc template that you can use. :)

@KagurazakaHanabi
Copy link
Contributor Author

@justinmc
Copy link
Contributor

The design doc looks good to me. @KagurazakaHanabi can you continue with the steps in the breaking change policy (here)?

@Piinks
Copy link
Contributor

Piinks commented May 6, 2020

Hi @KagurazakaHanabi are you planning on continuing with this change?

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 31, 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.

CupertinoContextMenuAction should have a trailing widget rather than just an IconData trailingIcon

7 participants