@@ -10,7 +10,23 @@ class CreateFlameGame extends CreateSubCommand with OrgName {
1010 required super .logger,
1111 required super .generatorFromBundle,
1212 required super .generatorFromBrick,
13- });
13+ }) {
14+ argParser.addMultiOption (
15+ 'platforms' ,
16+ help:
17+ 'The platforms supported by the game. By default, all platforms '
18+ 'are enabled. Example: --platforms=android,ios' ,
19+ defaultsTo: ['android' , 'ios' , 'web' , 'macos' , 'windows' ],
20+ allowed: ['android' , 'ios' , 'web' , 'macos' , 'windows' ],
21+ allowedHelp: {
22+ 'android' : 'The game supports the Android platform.' ,
23+ 'ios' : 'The game supports the iOS platform.' ,
24+ 'web' : 'The game supports the Web platform.' ,
25+ 'macos' : 'The game supports the macOS platform.' ,
26+ 'windows' : 'The game supports the Windows platform.' ,
27+ },
28+ );
29+ }
1430
1531 @override
1632 String get name => 'flame_game' ;
@@ -20,4 +36,15 @@ class CreateFlameGame extends CreateSubCommand with OrgName {
2036
2137 @override
2238 Template get template => VeryGoodFlameGameTemplate ();
39+
40+ @override
41+ Map <String , dynamic > getTemplateVars () {
42+ final vars = super .getTemplateVars ();
43+
44+ final platforms = argResults['platforms' ] as List <String >;
45+
46+ vars['platforms' ] = platforms;
47+
48+ return vars;
49+ }
2350}
0 commit comments