Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Property Editor] Handle deprecated widget arguments#9062

Merged
elliette merged 3 commits intoflutter:masterfrom
elliette:issue-8930
Mar 25, 2025
Merged

[Property Editor] Handle deprecated widget arguments#9062
elliette merged 3 commits intoflutter:masterfrom
elliette:issue-8930

Conversation

@elliette
Copy link
Member

Fixes #8930

  • Property Editor does not show inputs for arguments that are deprecated and are not set in the source code
  • Property Editor does include input if deprecated and value is set in the source code, and shows a label that the argument is deprecated
Screenshot 2025-03-24 at 10 35 26 AM

@elliette elliette requested a review from a team as a code owner March 24, 2025 18:21
@elliette elliette requested review from bkonyi and removed request for a team March 24, 2025 18:21
@elliette elliette requested a review from kenzieschmoll March 24, 2025 19:54
}
}

bool notDeprecatedWithNoValue(EditableArgument argument) =>
Copy link
Member

Choose a reason for hiding this comment

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

nit: consider making this function phrased in the positive deprecatedAndNotSet and then negate it where you call the method. I think this would make it easier to read rather than having to mentally parse the negatives.

Copy link
Member

@kenzieschmoll kenzieschmoll Mar 24, 2025

Choose a reason for hiding this comment

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

It actually seems like the case we want to check for is deprecatedAndSet right? and then we only include properties that are either not deprecated or deprecatedAndSet?

Copy link
Member Author

Choose a reason for hiding this comment

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

Haha yeah, I removed this method and just added the filter condition inline to where we actually filter out the deprecated properties. I think with a comment this is more clear than trying to come up with a descriptive method name:

// Filter out any deprecated properties that aren't set.
.where((property) => !property.isDeprecated || property.hasArgument)

@elliette elliette merged commit caa9d79 into flutter:master Mar 25, 2025
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Property editor should show when fields are deprecated

2 participants