prefer const constructors (#8316)
This commit is contained in:
committed by
Adam Barth
parent
663862557b
commit
e9a775bf38
@@ -37,6 +37,6 @@ void main() {
|
||||
await new Future<Null>.delayed(kWaitBetweenActions);
|
||||
}
|
||||
await completer.future;
|
||||
}, timeout: new Timeout(new Duration(minutes: 1)));
|
||||
}, timeout: const Timeout(const Duration(minutes: 1)));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -34,14 +34,14 @@ void main() {
|
||||
// https://github.com/flutter/flutter/issues/3316
|
||||
// Scroll down
|
||||
for (int i = 0; i < 5; i++) {
|
||||
await driver.scroll(stockList, 0.0, -300.0, new Duration(milliseconds: 300));
|
||||
await new Future<Null>.delayed(new Duration(milliseconds: 500));
|
||||
await driver.scroll(stockList, 0.0, -300.0, const Duration(milliseconds: 300));
|
||||
await new Future<Null>.delayed(const Duration(milliseconds: 500));
|
||||
}
|
||||
|
||||
// Scroll up
|
||||
for (int i = 0; i < 5; i++) {
|
||||
await driver.scroll(stockList, 0.0, 300.0, new Duration(milliseconds: 300));
|
||||
await new Future<Null>.delayed(new Duration(milliseconds: 500));
|
||||
await driver.scroll(stockList, 0.0, 300.0, const Duration(milliseconds: 300));
|
||||
await new Future<Null>.delayed(const Duration(milliseconds: 500));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ final List<String> unsynchedDemoTitles = <String>[
|
||||
'Progress indicators',
|
||||
];
|
||||
|
||||
final FileSystem _fs = new LocalFileSystem();
|
||||
final FileSystem _fs = const LocalFileSystem();
|
||||
|
||||
const Duration kWaitBetweenActions = const Duration(milliseconds: 250);
|
||||
|
||||
@@ -123,7 +123,7 @@ Future<Null> saveDurationsHistogram(List<Map<String, dynamic>> events, String ou
|
||||
|
||||
// Save the durations Map to a file.
|
||||
final File file = await _fs.file(outputPath).create(recursive: true);
|
||||
await file.writeAsString(new JsonEncoder.withIndent(' ').convert(durations));
|
||||
await file.writeAsString(const JsonEncoder.withIndent(' ').convert(durations));
|
||||
}
|
||||
|
||||
void main() {
|
||||
@@ -176,6 +176,6 @@ void main() {
|
||||
await summary.writeSummaryToFile('transitions', pretty: true);
|
||||
String histogramPath = path.join(testOutputsDirectory, 'transition_durations.timeline.json');
|
||||
await saveDurationsHistogram(timeline.json['traceEvents'], histogramPath);
|
||||
}, timeout: new Timeout(new Duration(minutes: 5)));
|
||||
}, timeout: const Timeout(const Duration(minutes: 5)));
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user