@@ -25,19 +25,19 @@ class DriveExamplesCommand extends PackageLoopingCommand {
2525 ProcessRunner processRunner = const ProcessRunner (),
2626 Platform platform = const LocalPlatform (),
2727 }) : super (packagesDir, processRunner: processRunner, platform: platform) {
28- argParser.addFlag (kPlatformAndroid ,
28+ argParser.addFlag (platformAndroid ,
2929 help: 'Runs the Android implementation of the examples' );
30- argParser.addFlag (kPlatformIos ,
30+ argParser.addFlag (platformIOS ,
3131 help: 'Runs the iOS implementation of the examples' );
32- argParser.addFlag (kPlatformLinux ,
32+ argParser.addFlag (platformLinux ,
3333 help: 'Runs the Linux implementation of the examples' );
34- argParser.addFlag (kPlatformMacos ,
34+ argParser.addFlag (platformMacOS ,
3535 help: 'Runs the macOS implementation of the examples' );
36- argParser.addFlag (kPlatformWeb ,
36+ argParser.addFlag (platformWeb ,
3737 help: 'Runs the web implementation of the examples' );
38- argParser.addFlag (kPlatformWindows ,
38+ argParser.addFlag (platformWindows ,
3939 help: 'Runs the Windows (Win32) implementation of the examples' );
40- argParser.addFlag (kPlatformWinUwp ,
40+ argParser.addFlag (platformWinUwp ,
4141 help:
4242 'Runs the UWP implementation of the examples [currently a no-op]' );
4343 argParser.addOption (
@@ -64,13 +64,13 @@ class DriveExamplesCommand extends PackageLoopingCommand {
6464 @override
6565 Future <void > initializeRun () async {
6666 final List <String > platformSwitches = < String > [
67- kPlatformAndroid ,
68- kPlatformIos ,
69- kPlatformLinux ,
70- kPlatformMacos ,
71- kPlatformWeb ,
72- kPlatformWindows ,
73- kPlatformWinUwp ,
67+ platformAndroid ,
68+ platformIOS ,
69+ platformLinux ,
70+ platformMacOS ,
71+ platformWeb ,
72+ platformWindows ,
73+ platformWinUwp ,
7474 ];
7575 final int platformCount = platformSwitches
7676 .where ((String platform) => getBoolArg (platform))
@@ -85,12 +85,12 @@ class DriveExamplesCommand extends PackageLoopingCommand {
8585 throw ToolExit (_exitNoPlatformFlags);
8686 }
8787
88- if (getBoolArg (kPlatformWinUwp )) {
88+ if (getBoolArg (platformWinUwp )) {
8989 logWarning ('Driving UWP applications is not yet supported' );
9090 }
9191
9292 String ? androidDevice;
93- if (getBoolArg (kPlatformAndroid )) {
93+ if (getBoolArg (platformAndroid )) {
9494 final List <String > devices = await _getDevicesForPlatform ('android' );
9595 if (devices.isEmpty) {
9696 printError ('No Android devices available' );
@@ -99,37 +99,36 @@ class DriveExamplesCommand extends PackageLoopingCommand {
9999 androidDevice = devices.first;
100100 }
101101
102- String ? iosDevice ;
103- if (getBoolArg (kPlatformIos )) {
102+ String ? iOSDevice ;
103+ if (getBoolArg (platformIOS )) {
104104 final List <String > devices = await _getDevicesForPlatform ('ios' );
105105 if (devices.isEmpty) {
106106 printError ('No iOS devices available' );
107107 throw ToolExit (_exitNoAvailableDevice);
108108 }
109- iosDevice = devices.first;
109+ iOSDevice = devices.first;
110110 }
111111
112112 _targetDeviceFlags = < String , List <String >> {
113- if (getBoolArg (kPlatformAndroid ))
114- kPlatformAndroid : < String > ['-d' , androidDevice! ],
115- if (getBoolArg (kPlatformIos )) kPlatformIos : < String > ['-d' , iosDevice ! ],
116- if (getBoolArg (kPlatformLinux )) kPlatformLinux : < String > ['-d' , 'linux' ],
117- if (getBoolArg (kPlatformMacos )) kPlatformMacos : < String > ['-d' , 'macos' ],
118- if (getBoolArg (kPlatformWeb ))
119- kPlatformWeb : < String > [
113+ if (getBoolArg (platformAndroid ))
114+ platformAndroid : < String > ['-d' , androidDevice! ],
115+ if (getBoolArg (platformIOS )) platformIOS : < String > ['-d' , iOSDevice ! ],
116+ if (getBoolArg (platformLinux )) platformLinux : < String > ['-d' , 'linux' ],
117+ if (getBoolArg (platformMacOS )) platformMacOS : < String > ['-d' , 'macos' ],
118+ if (getBoolArg (platformWeb ))
119+ platformWeb : < String > [
120120 '-d' ,
121121 'web-server' ,
122122 '--web-port=7357' ,
123123 '--browser-name=chrome' ,
124124 if (platform.environment.containsKey ('CHROME_EXECUTABLE' ))
125125 '--chrome-binary=${platform .environment ['CHROME_EXECUTABLE' ]}' ,
126126 ],
127- if (getBoolArg (kPlatformWindows ))
128- kPlatformWindows : < String > ['-d' , 'windows' ],
127+ if (getBoolArg (platformWindows ))
128+ platformWindows : < String > ['-d' , 'windows' ],
129129 // TODO(stuartmorgan): Check these flags once drive supports UWP:
130130 // https://github.com/flutter/flutter/issues/82821
131- if (getBoolArg (kPlatformWinUwp))
132- kPlatformWinUwp: < String > ['-d' , 'winuwp' ],
131+ if (getBoolArg (platformWinUwp)) platformWinUwp: < String > ['-d' , 'winuwp' ],
133132 };
134133 }
135134
@@ -148,9 +147,9 @@ class DriveExamplesCommand extends PackageLoopingCommand {
148147 in _targetDeviceFlags.entries) {
149148 final String platform = entry.key;
150149 String ? variant;
151- if (platform == kPlatformWindows ) {
150+ if (platform == platformWindows ) {
152151 variant = platformVariantWin32;
153- } else if (platform == kPlatformWinUwp ) {
152+ } else if (platform == platformWinUwp ) {
154153 variant = platformVariantWinUwp;
155154 // TODO(stuartmorgan): Remove this once drive supports UWP.
156155 // https://github.com/flutter/flutter/issues/82821
0 commit comments