Skip to content
This repository was archived by the owner on Jun 13, 2024. It is now read-only.

Rename CardDemoType and type #311

Merged
merged 2 commits into from
Sep 16, 2020
Merged

Rename CardDemoType and type #311

merged 2 commits into from
Sep 16, 2020

Conversation

pennzht
Copy link
Member

@pennzht pennzht commented Sep 16, 2020

Rename

  • CardDemoTypeCardType
  • typecardType

allowing DartPad code generator to better understand them.

Explanation

The DartPad code generator looks for all variables named type and replaces them with a specific demo type; for example, in material/dialog_demo.dart, the variable type always refer to the type of the demo we are running (one of alert, alertTitle, simple, fullscreen), so the code generator will replace type with DialogDemoType.alert, DialogDemoType.alertTitle, DialogDemoType.simple, and DialogDemoType.fullscreen in order to generate standalone apps for each demo type.

Since the type in material/cards_demo.dart refers to the type of the card we use, instead of the type of the demo, renaming it to cardType allows the code generator to avoid replacing them.

@pennzht pennzht requested a review from JoseAlba September 16, 2020 10:46
@pennzht pennzht changed the title Rename type Rename CardDemoType and type Sep 16, 2020
Copy link
Contributor

@JoseAlba JoseAlba left a comment

Choose a reason for hiding this comment

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

██╗      ██████╗ ████████╗███╗   ███╗
██║     ██╔════╝ ╚══██╔══╝████╗ ████║
██║     ██║  ███╗   ██║   ██╔████╔██║
██║     ██║   ██║   ██║   ██║╚██╔╝██║
███████╗╚██████╔╝   ██║   ██║ ╚═╝ ██║
╚══════╝ ╚═════╝    ╚═╝   ╚═╝     ╚═╝

Copy link
Member

@guidezpl guidezpl left a comment

Choose a reason for hiding this comment

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

  _    ___ _____ __  __ 
 | |  / __|_   _|  \/  |
 | |_| (_ | | | | |\/| |
 |____\___| |_| |_|  |_|
                        

perclasson pushed a commit to perclasson/gallery that referenced this pull request Sep 16, 2020
@pennzht pennzht merged commit 5f3c724 into flutter:master Sep 16, 2020
@pennzht pennzht deleted the rename-type branch September 16, 2020 13:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants