Refactor gen_defaults to support multiple generated code blocks in the same file independently.#107278
Merged
darrenaustin merged 3 commits intoflutter:masterfrom Jul 11, 2022
darrenaustin:gen_defaults_multiple_blocks
Merged
Refactor gen_defaults to support multiple generated code blocks in the same file independently.#107278darrenaustin merged 3 commits intoflutter:masterfrom darrenaustin:gen_defaults_multiple_blocks
darrenaustin merged 3 commits intoflutter:masterfrom
darrenaustin:gen_defaults_multiple_blocks
Conversation
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)
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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_defaultsscript 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
///).