Skip to content

Conversation

@arbaker2
Copy link
Contributor

@arbaker2 arbaker2 commented Jul 7, 2024

This PR allows for an optional argument [inverted[ to be passed to the [getOuterPath] method of a CircularNotchedRectangle object in order to invert the notch for situations where it is desired to draw the notch on the bottom of the path. This allows both of the below paths in the below screenshot to be drawn and changes no default behavior.

Simulator Screenshot - iPhone 15 - 2024-07-07 at 11 46 12

List which issues are fixed by this PR. You must list at least one issue. An issue is not required if the PR fixes something trivial like a typo.
This add a feature similar to the one discussed in #49973, original feature proposal #151381

If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@github-actions github-actions bot added the framework flutter/packages/flutter repository. See also f: labels. label Jul 7, 2024
@arbaker2 arbaker2 changed the title Add support for inverting CircularNotchedRectangle to be drawn on the bottom of a path Add support for inverting CircularNotchedRectangle to optionally be drawn on the bottom of a path Jul 8, 2024
@goderbauer goderbauer requested a review from nate-thegrate July 9, 2024 22:07
Copy link
Contributor

@nate-thegrate nate-thegrate left a comment

Choose a reason for hiding this comment

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

There's a little bit that I don't like about this getOuterPath() method, but it's not related to the changes you've made here.

LGTM, thanks for the fantastic contribution!

@nate-thegrate
Copy link
Contributor

We'll be able to merge this pull request once it gets a second approval.

No guarantees, but hopefully it'll be within a few days!

@arbaker2
Copy link
Contributor Author

We'll be able to merge this pull request once it gets a second approval.

No guarantees, but hopefully it'll be within a few days!

Great! Thanks so much Nate! And I appreciate the update to the comments. Your update was much more clear and concise.

@bleroux
Copy link
Contributor

bleroux commented Jul 12, 2024

Thanks for this good quality PR!

I don't have access to the Google testing failures but It might be related to the added parameter because it will break CircularNotchedRectangle subclasses which override getOuterPath.
I found this related discussion: dart-lang/sdk#36027.

The PR description points to #49973, can you explain how one can use this PR to get the shape proposed in #49973?

@arbaker2
Copy link
Contributor Author

Thanks for this good quality PR!

I don't have access to the Google testing failures but It might be related to the added parameter because it will break CircularNotchedRectangle subclasses which override getOuterPath. I found this related discussion: dart-lang/sdk#36027.

The PR description points to #49973, can you explain how one can use this PR to get the shape proposed in #49973?

It is strange to me that this test failed as the PR with 1 commit passed all tests. The only change in the second commit was a change in comments recommended by @nate-thegrate. There is not much detail on the test as to why it failed. Is there a way to re-run the checks to verify there is an issue?

Also, this PR does not allow for the shape in #49973. I originally opened up an issue #151381 which was closed because it was too similar to #49973. So that is why this PR is linked to this issue.

@bleroux
Copy link
Contributor

bleroux commented Jul 12, 2024

It is strange to me that this test failed as the PR with 1 commit passed all tests. The only change in the second commit was a change in comments recommended by @nate-thegrate. There is not much detail on the test as to why it failed. Is there a way to re-run the checks to verify there is an issue?

I agree this is confusing. FYI, this is not related to your second commit.
When a PR is filed the 'Google testing' step is not run. It is run once there is one approval (I don't remember if there is a delay here).

To re-run the check I clicked on 'Details' and then 'Re-run' (I dont know if one have to be a team member to do this). Pushing an empty commit or using the Github 'Update with rebase' button are ways to trigger the whole checks.

@bleroux
Copy link
Contributor

bleroux commented Jul 12, 2024

Great the check is green now.

@goderbauer
Are we ok with a change that might break subclasses?
This PR adds an optional parameter to CircularNotchedRectangle.getOuterPath. There are no subclasses that override this method in the framework and in the customer tests, so can we assume this is not a breaking change?

@nate-thegrate
Copy link
Contributor

@bleroux thanks for bringing up the concern about breaking subclasses; it didn't even cross my mind till now.

It looks like there isn't any benefit to subclassing CircularNotchedRectangle directly rather than just making another subclass of NotchedShape.


That being said, there is a pretty straightforward way to mitigate subclass breakages:

class CircularNotchedRectangle extends NotchedShape {
  const CircularNotchedRectangle({this.inverted = false});

  final bool inverted;

  @override
  Path getOuterPath(Rect host, Rect? guest) {
    // ...
  }
}

Perhaps it'd be best to implement this way, since AutomaticNotchedShape also uses class members rather than optional method arguments.

@arbaker2
Copy link
Contributor Author

@nate-thegrate @bleroux I am aligned with this adjustment as well. Thanks for bringing up these helpful concerns and suggested improvements! I can work to add another commit with this implemented.

@arbaker2
Copy link
Contributor Author

@nate-thegrate @bleroux let me know if these changes look good to you or if further updates are needed. Thanks so much!

@nate-thegrate nate-thegrate requested a review from bleroux July 15, 2024 17:30
Copy link
Contributor

@bleroux bleroux 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 this quality PR and for your reactivity 🙏

@arbaker2
Copy link
Contributor Author

@nate-thegrate @bleroux thank you both for your help reviewing this PR!

@nate-thegrate nate-thegrate added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 15, 2024
@auto-submit auto-submit bot merged commit 30bf288 into flutter:master Jul 15, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 16, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 16, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 16, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 17, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 17, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 17, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 17, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 17, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 17, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 17, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 17, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 18, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 18, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 18, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 18, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 18, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 18, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 18, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 19, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 19, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 19, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 19, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 19, 2024
TytaniumDev pushed a commit to TytaniumDev/flutter that referenced this pull request Aug 7, 2024
…rawn on the bottom of a path (flutter#151386)

This PR allows for an optional argument [inverted[ to be passed to the [getOuterPath] method of a CircularNotchedRectangle object in order to invert the notch for situations where it is desired to draw the notch on the bottom of the path. This allows both of the below paths in the below screenshot to be drawn and changes no default behavior. 

![Simulator Screenshot - iPhone 15 - 2024-07-07 at 11 46 12](https://github.com/flutter/flutter/assets/71237742/57c1370d-19dd-4f65-aa85-f15723a4843b)

*List which issues are fixed by this PR. You must list at least one issue. An issue is not required if the PR fixes something trivial like a typo.*
This add a feature similar to the one discussed in flutter#49973, original feature proposal flutter#151381

*If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
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 framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants