-
Notifications
You must be signed in to change notification settings - Fork 28.5k
Refactor gen_defaults to support multiple generated code blocks in the same file independently. #107278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
darrenaustin
merged 3 commits into
flutter:master
from
darrenaustin:gen_defaults_multiple_blocks
Jul 11, 2022
Merged
Refactor gen_defaults to support multiple generated code blocks in the same file independently. #107278
darrenaustin
merged 3 commits into
flutter:master
from
darrenaustin:gen_defaults_multiple_blocks
Jul 11, 2022
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
guidezpl
approved these changes
Jul 8, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
HansMuller
approved these changes
Jul 8, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
QuncCccccc
approved these changes
Jul 8, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
8 tasks
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Jul 11, 2022
…ks in the same file independently. (flutter/flutter#107278)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
Jul 12, 2022
…ks in the same file independently. (flutter/flutter#107278)
camsim99
pushed a commit
to camsim99/flutter
that referenced
this pull request
Aug 10, 2022
…e same file independently. (flutter#107278)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Aug 30, 2022
…ks in the same file independently. (flutter/flutter#107278)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
Aug 30, 2022
…ks in the same file independently. (flutter/flutter#107278)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
a: text input
Entering text in a text field or keyboard related problems
c: contributor-productivity
Team-specific productivity, code health, technical debt.
f: material design
flutter/packages/flutter/material repository.
framework
flutter/packages/flutter repository. See also f: labels.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The current
gen_defaults
script will only allow a single block of code to be appended to the end of a file. This PR refactors it such that each block is given a name and can be anywhere in the file and updated properly. This will allow us to have multiple generated blocks in a given file and have them updated independently. This in turn will make it easier to support multiple variants of tokens in a single file (say for different button variants).In addition I added some more internal documentation as well as a new test to check the updating of multiple blocks in a file.
As part of this PR I regenerated all the existing code blocks to match the new format. While doing so, I took the liberty to clean up the naming for the generated (FooDefaultsM3) and hand coded (FooDefaultsM2) FooThemeData classes so that they are consistent across all the widgets.
Pre-launch Checklist
///
).