whitespace cleanup (#14458)
This commit is contained in:
parent
f5dea9325b
commit
3c379aaf43
@ -544,7 +544,7 @@ Future<Null> _verifyGeneratedPluginRegistrants(String flutterRoot) async {
|
||||
|
||||
for (String package in packageToRegistrants.keys) {
|
||||
final Map<File, String> fileToContent = <File, String>{};
|
||||
for(File f in packageToRegistrants[package]) {
|
||||
for (File f in packageToRegistrants[package]) {
|
||||
fileToContent[f] = f.readAsStringSync();
|
||||
}
|
||||
await _runCommand(flutter, <String>['inject-plugins'],
|
||||
|
@ -23,7 +23,7 @@ Future<Null> main(List<String> rawArgs) async {
|
||||
ArgResults args;
|
||||
try {
|
||||
args = _argParser.parse(rawArgs);
|
||||
} on FormatException catch(error) {
|
||||
} on FormatException catch (error) {
|
||||
stderr.writeln('${error.message}\n');
|
||||
stderr.writeln('Usage:\n');
|
||||
stderr.writeln(_argParser.usage);
|
||||
|
@ -77,7 +77,7 @@ void main() {
|
||||
return new TaskResult.failure('Gradle did not produce an apk file at the expected place');
|
||||
|
||||
return new TaskResult.success(null);
|
||||
} catch(e) {
|
||||
} catch (e) {
|
||||
return new TaskResult.failure(e.toString());
|
||||
} finally {
|
||||
project.parent.deleteSync(recursive: true);
|
||||
|
@ -170,7 +170,7 @@ class AndroidDeviceDiscovery implements DeviceDiscovery {
|
||||
// TODO(yjbanov): check battery level
|
||||
await device._getWakefulness();
|
||||
results['android-device-$deviceId'] = new HealthCheckResult.success();
|
||||
} catch(e, s) {
|
||||
} catch (e, s) {
|
||||
results['android-device-$deviceId'] = new HealthCheckResult.error(e, s);
|
||||
}
|
||||
}
|
||||
|
@ -476,7 +476,7 @@ String extractCloudAuthTokenArg(List<String> rawArgs) {
|
||||
ArgResults args;
|
||||
try {
|
||||
args = argParser.parse(rawArgs);
|
||||
} on FormatException catch(error) {
|
||||
} on FormatException catch (error) {
|
||||
stderr.writeln('${error.message}\n');
|
||||
stderr.writeln('Usage:\n');
|
||||
stderr.writeln(argParser.usage);
|
||||
|
@ -36,7 +36,7 @@ void main() {
|
||||
test(testDescription, () {
|
||||
try {
|
||||
loadTaskManifest(yaml);
|
||||
} on ManifestError catch(error) {
|
||||
} on ManifestError catch (error) {
|
||||
expect(error.message, errorMessage);
|
||||
}
|
||||
});
|
||||
|
@ -96,7 +96,7 @@ String generateTranslationBundles() {
|
||||
|
||||
final Map<String, List<String>> languageToLocales = <String, List<String>>{};
|
||||
final Set<String> allResourceIdentifiers = new Set<String>();
|
||||
for(String locale in localeToResources.keys.toList()..sort()) {
|
||||
for (String locale in localeToResources.keys.toList()..sort()) {
|
||||
final List<String> codes = locale.split('_'); // [language, country]
|
||||
assert(codes.length == 1 || codes.length == 2);
|
||||
languageToLocales[codes[0]] ??= <String>[];
|
||||
@ -142,7 +142,7 @@ class TranslationBundle {
|
||||
// @override String get scriptCategory => r'English-like';
|
||||
// ...
|
||||
// }
|
||||
for(String language in languageToLocales.keys) {
|
||||
for (String language in languageToLocales.keys) {
|
||||
final Map<String, String> resources = localeToResources[language];
|
||||
output.writeln('''
|
||||
|
||||
@ -170,9 +170,9 @@ class _Bundle_$language extends TranslationBundle {
|
||||
// @override String get licensesPageTitle => r'Licences';
|
||||
// ...
|
||||
// }
|
||||
for(String language in languageToLocales.keys) {
|
||||
for (String language in languageToLocales.keys) {
|
||||
final Map<String, String> languageResources = localeToResources[language];
|
||||
for(String localeName in languageToLocales[language]) {
|
||||
for (String localeName in languageToLocales[language]) {
|
||||
if (localeName == language)
|
||||
continue;
|
||||
final Map<String, String> localeResources = localeToResources[localeName];
|
||||
@ -198,8 +198,8 @@ class _Bundle_$localeName extends TranslationBundle {
|
||||
output.writeln('''
|
||||
|
||||
TranslationBundle translationBundleForLocale(Locale locale) {
|
||||
switch(locale.languageCode) {''');
|
||||
for(String language in languageToLocales.keys) {
|
||||
switch (locale.languageCode) {''');
|
||||
for (String language in languageToLocales.keys) {
|
||||
if (languageToLocales[language].length == 1) {
|
||||
output.writeln('''
|
||||
case \'$language\':
|
||||
@ -207,8 +207,8 @@ TranslationBundle translationBundleForLocale(Locale locale) {
|
||||
} else {
|
||||
output.writeln('''
|
||||
case \'$language\': {
|
||||
switch(locale.toString()) {''');
|
||||
for(String localeName in languageToLocales[language]) {
|
||||
switch (locale.toString()) {''');
|
||||
for (String localeName in languageToLocales[language]) {
|
||||
if (localeName == language)
|
||||
continue;
|
||||
output.writeln('''
|
||||
|
@ -29,9 +29,9 @@ class Stock {
|
||||
// FIXME: This class should only have static data, not lastSale, etc.
|
||||
// "Symbol","Name","LastSale","MarketCap","IPOyear","Sector","industry","Summary Quote",
|
||||
lastSale = 0.0;
|
||||
try{
|
||||
try {
|
||||
lastSale = double.parse(fields[2]);
|
||||
} catch(_) {}
|
||||
} catch (_) {}
|
||||
symbol = fields[0];
|
||||
name = fields[1];
|
||||
marketCap = fields[4];
|
||||
|
@ -340,7 +340,7 @@ class WidgetInspectorService {
|
||||
|
||||
List<_DiagnosticsPathNode> _getRenderObjectParentChain(RenderObject renderObject, String groupName) {
|
||||
final List<RenderObject> chain = <RenderObject>[];
|
||||
while(renderObject != null) {
|
||||
while (renderObject != null) {
|
||||
chain.add(renderObject);
|
||||
renderObject = renderObject.parent;
|
||||
}
|
||||
|
@ -66,11 +66,11 @@ void main() {
|
||||
try {
|
||||
await channel.invokeMethod('sayHello', 'hello');
|
||||
fail('Exception expected');
|
||||
} on PlatformException catch(e) {
|
||||
} on PlatformException catch (e) {
|
||||
expect(e.code, equals('bad'));
|
||||
expect(e.message, equals('Something happened'));
|
||||
expect(e.details, equals(<String, dynamic>{'a': 42, 'b': 3.14}));
|
||||
} catch(e) {
|
||||
} catch (e) {
|
||||
fail('PlatformException expected');
|
||||
}
|
||||
});
|
||||
@ -82,10 +82,10 @@ void main() {
|
||||
try {
|
||||
await channel.invokeMethod('sayHello', 'hello');
|
||||
fail('Exception expected');
|
||||
} on MissingPluginException catch(e) {
|
||||
} on MissingPluginException catch (e) {
|
||||
expect(e.message, contains('sayHello'));
|
||||
expect(e.message, contains('ch7'));
|
||||
} catch(e) {
|
||||
} catch (e) {
|
||||
fail('MissingPluginException expected');
|
||||
}
|
||||
});
|
||||
@ -130,7 +130,7 @@ void main() {
|
||||
try {
|
||||
jsonMethod.decodeEnvelope(envelope);
|
||||
fail('Exception expected');
|
||||
} on PlatformException catch(e) {
|
||||
} on PlatformException catch (e) {
|
||||
expect(e.code, equals('bad'));
|
||||
expect(e.message, equals('sayHello failed'));
|
||||
} catch (e) {
|
||||
@ -149,7 +149,7 @@ void main() {
|
||||
try {
|
||||
jsonMethod.decodeEnvelope(envelope);
|
||||
fail('Exception expected');
|
||||
} on PlatformException catch(e) {
|
||||
} on PlatformException catch (e) {
|
||||
expect(e.code, equals('error'));
|
||||
expect(e.message, equals('Invalid argument(s): bad'));
|
||||
} catch (e) {
|
||||
|
@ -568,7 +568,7 @@ class FlutterDriver {
|
||||
'recordedStreams': _timelineStreamsToString(streams)
|
||||
}).timeout(timeout);
|
||||
return null;
|
||||
} catch(error, stackTrace) {
|
||||
} catch (error, stackTrace) {
|
||||
throw new DriverError(
|
||||
'Failed to start tracing due to remote error',
|
||||
error,
|
||||
@ -584,7 +584,7 @@ class FlutterDriver {
|
||||
.sendRequest(_kSetVMTimelineFlagsMethod, <String, String>{'recordedStreams': '[]'})
|
||||
.timeout(timeout);
|
||||
return new Timeline.fromJson(await _peer.sendRequest(_kGetVMTimelineMethod));
|
||||
} catch(error, stackTrace) {
|
||||
} catch (error, stackTrace) {
|
||||
throw new DriverError(
|
||||
'Failed to stop tracing due to remote error',
|
||||
error,
|
||||
@ -626,7 +626,7 @@ class FlutterDriver {
|
||||
await _peer
|
||||
.sendRequest(_kClearVMTimelineMethod, <String, String>{})
|
||||
.timeout(timeout);
|
||||
} catch(error, stackTrace) {
|
||||
} catch (error, stackTrace) {
|
||||
throw new DriverError(
|
||||
'Failed to clear event timeline due to remote error',
|
||||
error,
|
||||
@ -723,7 +723,7 @@ Future<VMServiceClientConnection> _waitAndConnect(String url) async {
|
||||
new VMServiceClient(new IOWebSocketChannel(ws1).cast()),
|
||||
new rpc.Peer(new IOWebSocketChannel(ws2).cast())..listen()
|
||||
);
|
||||
} catch(e) {
|
||||
} catch (e) {
|
||||
await ws1?.close();
|
||||
await ws2?.close();
|
||||
|
||||
|
@ -363,7 +363,7 @@ void main() {
|
||||
try {
|
||||
await driver.waitFor(find.byTooltip('foo'), timeout: const Duration(milliseconds: 100));
|
||||
fail('expected an exception');
|
||||
} catch(error) {
|
||||
} catch (error) {
|
||||
expect(error is DriverError, isTrue);
|
||||
expect(error.message, 'Failed to fulfill WaitFor: Flutter application not responding');
|
||||
}
|
||||
@ -378,7 +378,7 @@ void main() {
|
||||
try {
|
||||
await driver.waitFor(find.byTooltip('foo'));
|
||||
fail('expected an exception');
|
||||
} catch(error) {
|
||||
} catch (error) {
|
||||
expect(error is DriverError, isTrue);
|
||||
expect(error.message, 'Error in Flutter application: {message: This is a failure}');
|
||||
}
|
||||
|
@ -1397,18 +1397,18 @@ class _Bundle_zh_TW extends TranslationBundle {
|
||||
}
|
||||
|
||||
TranslationBundle translationBundleForLocale(Locale locale) {
|
||||
switch(locale.languageCode) {
|
||||
switch (locale.languageCode) {
|
||||
case 'ar':
|
||||
return const _Bundle_ar();
|
||||
case 'de': {
|
||||
switch(locale.toString()) {
|
||||
switch (locale.toString()) {
|
||||
case 'de_CH':
|
||||
return const _Bundle_de_CH();
|
||||
}
|
||||
return const _Bundle_de();
|
||||
}
|
||||
case 'en': {
|
||||
switch(locale.toString()) {
|
||||
switch (locale.toString()) {
|
||||
case 'en_AU':
|
||||
return const _Bundle_en_AU();
|
||||
case 'en_CA':
|
||||
@ -1427,7 +1427,7 @@ TranslationBundle translationBundleForLocale(Locale locale) {
|
||||
return const _Bundle_en();
|
||||
}
|
||||
case 'es': {
|
||||
switch(locale.toString()) {
|
||||
switch (locale.toString()) {
|
||||
case 'es_419':
|
||||
return const _Bundle_es_419();
|
||||
case 'es_AR':
|
||||
@ -1474,7 +1474,7 @@ TranslationBundle translationBundleForLocale(Locale locale) {
|
||||
case 'fa':
|
||||
return const _Bundle_fa();
|
||||
case 'fr': {
|
||||
switch(locale.toString()) {
|
||||
switch (locale.toString()) {
|
||||
case 'fr_CA':
|
||||
return const _Bundle_fr_CA();
|
||||
}
|
||||
@ -1497,7 +1497,7 @@ TranslationBundle translationBundleForLocale(Locale locale) {
|
||||
case 'ps':
|
||||
return const _Bundle_ps();
|
||||
case 'pt': {
|
||||
switch(locale.toString()) {
|
||||
switch (locale.toString()) {
|
||||
case 'pt_PT':
|
||||
return const _Bundle_pt_PT();
|
||||
}
|
||||
@ -1514,7 +1514,7 @@ TranslationBundle translationBundleForLocale(Locale locale) {
|
||||
case 'ur':
|
||||
return const _Bundle_ur();
|
||||
case 'zh': {
|
||||
switch(locale.toString()) {
|
||||
switch (locale.toString()) {
|
||||
case 'zh_HK':
|
||||
return const _Bundle_zh_HK();
|
||||
case 'zh_TW':
|
||||
|
@ -21,7 +21,7 @@ void main() {
|
||||
TestFailure failure;
|
||||
try {
|
||||
expect(find.text('foo', skipOffstage: false), findsOneWidget);
|
||||
} catch(e) {
|
||||
} catch (e) {
|
||||
failure = e;
|
||||
}
|
||||
|
||||
@ -44,7 +44,7 @@ void main() {
|
||||
TestFailure failure;
|
||||
try {
|
||||
expect(find.text('foo', skipOffstage: false), findsNothing);
|
||||
} catch(e) {
|
||||
} catch (e) {
|
||||
failure = e;
|
||||
}
|
||||
|
||||
@ -62,7 +62,7 @@ void main() {
|
||||
TestFailure failure;
|
||||
try {
|
||||
expect(find.text('foo'), findsNothing);
|
||||
} catch(e) {
|
||||
} catch (e) {
|
||||
failure = e;
|
||||
}
|
||||
|
||||
@ -117,7 +117,7 @@ void main() {
|
||||
TestFailure failure;
|
||||
try {
|
||||
expect(find.byElementPredicate((_) => false, description: customDescription), findsOneWidget);
|
||||
} catch(e) {
|
||||
} catch (e) {
|
||||
failure = e;
|
||||
}
|
||||
|
||||
@ -134,7 +134,7 @@ void main() {
|
||||
TestFailure failure;
|
||||
try {
|
||||
expect(find.byWidgetPredicate((_) => false, description: customDescription), findsOneWidget);
|
||||
} catch(e) {
|
||||
} catch (e) {
|
||||
failure = e;
|
||||
}
|
||||
|
||||
|
@ -238,7 +238,7 @@ class UpdatePackagesCommand extends FlutterCommand {
|
||||
final List<_DependencyLink> paths = <_DependencyLink>[];
|
||||
|
||||
traversalQueue.addFirst(new _DependencyLink(from: null, to: from));
|
||||
while(traversalQueue.isNotEmpty) {
|
||||
while (traversalQueue.isNotEmpty) {
|
||||
final _DependencyLink link = traversalQueue.removeLast();
|
||||
if (link.to == to)
|
||||
paths.add(link);
|
||||
|
@ -65,7 +65,7 @@ List<Plugin> _findPlugins(String directory) {
|
||||
try {
|
||||
final String packagesFile = fs.path.join(directory, PackageMap.globalPackagesPath);
|
||||
packages = new PackageMap(packagesFile).map;
|
||||
} on FormatException catch(e) {
|
||||
} on FormatException catch (e) {
|
||||
printTrace('Invalid .packages file: $e');
|
||||
return plugins;
|
||||
}
|
||||
|
@ -1045,7 +1045,7 @@ class Isolate extends ServiceObjectOwner {
|
||||
}
|
||||
final Map<String, dynamic> response = await invokeRpcRaw('_reloadSources', params: arguments);
|
||||
return response;
|
||||
} on rpc.RpcException catch(e) {
|
||||
} on rpc.RpcException catch (e) {
|
||||
return new Future<Map<String, dynamic>>.error(<String, dynamic>{
|
||||
'code': e.code,
|
||||
'message': e.message,
|
||||
|
Loading…
x
Reference in New Issue
Block a user