prefer const constructors (#8316)
This commit is contained in:
committed by
Adam Barth
parent
663862557b
commit
e9a775bf38
@@ -63,7 +63,7 @@ Future<Null> main(List<String> rawArgs) async {
|
||||
exitCode = 1;
|
||||
|
||||
print('Task result:');
|
||||
print(new JsonEncoder.withIndent(' ').convert(result));
|
||||
print(const JsonEncoder.withIndent(' ').convert(result));
|
||||
section('Finished task "$taskName"');
|
||||
}
|
||||
}
|
||||
@@ -115,7 +115,7 @@ final ArgParser _argParser = new ArgParser()
|
||||
splitCommas: true,
|
||||
callback: (List<String> value) {
|
||||
if (value.isNotEmpty) {
|
||||
throw new FormatException(
|
||||
throw const FormatException(
|
||||
'Invalid option --test. Did you mean --task (-t)?',
|
||||
);
|
||||
}
|
||||
|
||||
@@ -42,8 +42,8 @@ Future<Map<String, dynamic>> runTask(String taskName, { bool silent: false }) as
|
||||
});
|
||||
|
||||
StreamSubscription<String> stdoutSub = runner.stdout
|
||||
.transform(new Utf8Decoder())
|
||||
.transform(new LineSplitter())
|
||||
.transform(const Utf8Decoder())
|
||||
.transform(const LineSplitter())
|
||||
.listen((String line) {
|
||||
if (!silent) {
|
||||
stdout.writeln('[$taskName] [STDOUT] $line');
|
||||
@@ -51,8 +51,8 @@ Future<Map<String, dynamic>> runTask(String taskName, { bool silent: false }) as
|
||||
});
|
||||
|
||||
StreamSubscription<String> stderrSub = runner.stderr
|
||||
.transform(new Utf8Decoder())
|
||||
.transform(new LineSplitter())
|
||||
.transform(const Utf8Decoder())
|
||||
.transform(const LineSplitter())
|
||||
.listen((String line) {
|
||||
stderr.writeln('[$taskName] [STDERR] $line');
|
||||
});
|
||||
|
||||
@@ -318,7 +318,7 @@ T requireConfigProperty<T>(Map<String, dynamic> map, String propertyName) {
|
||||
}
|
||||
|
||||
String jsonEncode(dynamic data) {
|
||||
return new JsonEncoder.withIndent(' ').convert(data) + '\n';
|
||||
return const JsonEncoder.withIndent(' ').convert(data) + '\n';
|
||||
}
|
||||
|
||||
Future<Null> getFlutter(String revision) async {
|
||||
|
||||
@@ -305,12 +305,12 @@ class AndroidBackButtonMemoryTest {
|
||||
// Perform a series of back button suspend and resume cycles.
|
||||
for (int i = 0; i < 10; i++) {
|
||||
await device.shellExec('input', <String>['keyevent', 'KEYCODE_BACK']);
|
||||
await new Future<Null>.delayed(new Duration(milliseconds: 1000));
|
||||
await new Future<Null>.delayed(const Duration(milliseconds: 1000));
|
||||
String output = await device.shellEval('am', <String>['start', '-n', 'io.flutter.examples.gallery/io.flutter.app.FlutterActivity']);
|
||||
print(output);
|
||||
if (output.contains('Error'))
|
||||
return new TaskResult.failure('unable to launch activity');
|
||||
await new Future<Null>.delayed(new Duration(milliseconds: 1000));
|
||||
await new Future<Null>.delayed(const Duration(milliseconds: 1000));
|
||||
}
|
||||
|
||||
Map<String, dynamic> endData = await device.getMemoryStats(packageName);
|
||||
|
||||
Reference in New Issue
Block a user