apply lint prefer_void_to_null in dev/ (#22661)

This commit is contained in:
Alexandre Ardhuin
2018-10-04 18:44:23 +02:00
committed by GitHub
parent 89c5ace117
commit d340e2f229
107 changed files with 210 additions and 212 deletions

View File

@@ -20,12 +20,12 @@ void main() {
driver.close();
});
Future<Null> testScrollPerf(String listKey, String summaryName) async {
Future<void> testScrollPerf(String listKey, String summaryName) async {
// The slight initial delay avoids starting the timing during a
// period of increased load on the device. Without this delay, the
// benchmark has greater noise.
// See: https://github.com/flutter/flutter/issues/19434
await Future<Null>.delayed(const Duration(milliseconds: 250));
await Future<void>.delayed(const Duration(milliseconds: 250));
final Timeline timeline = await driver.traceAction(() async {
// Find the scrollable stock list
final SerializableFinder list = find.byValueKey(listKey);
@@ -34,13 +34,13 @@ void main() {
// Scroll down
for (int i = 0; i < 5; i += 1) {
await driver.scroll(list, 0.0, -300.0, const Duration(milliseconds: 300));
await Future<Null>.delayed(const Duration(milliseconds: 500));
await Future<void>.delayed(const Duration(milliseconds: 500));
}
// Scroll up
for (int i = 0; i < 5; i += 1) {
await driver.scroll(list, 0.0, 300.0, const Duration(milliseconds: 300));
await Future<Null>.delayed(const Duration(milliseconds: 500));
await Future<void>.delayed(const Duration(milliseconds: 500));
}
});

View File

@@ -25,7 +25,7 @@ void main() {
test('inital tree creation', () async {
// Let app become fully idle.
await Future<Null>.delayed(const Duration(seconds: 2));
await Future<void>.delayed(const Duration(seconds: 2));
final Timeline timeline = await driver.traceAction(() async {
expect(await driver.setSemantics(true), isTrue);

View File

@@ -37,7 +37,7 @@ Future<void> main() async {
/// Wait 50ms to allow the GPU thread to actually put up the frame. (The
/// endOfFrame future ends when we send the data to the engine, before the GPU
/// thread has had a chance to rasterize, etc.)
await Future<Null>.delayed(const Duration(milliseconds: 50));
await Future<void>.delayed(const Duration(milliseconds: 50));
debugPrint('==== MEMORY BENCHMARK ==== READY ====');
await ready.future; // waits for tap sent by devicelab task
@@ -58,14 +58,14 @@ Future<void> main() async {
for (int iteration = 0; iteration < maxIterations; iteration += 1) {
debugPrint('Scroll down... $iteration/$maxIterations');
await controller.fling(find.byType(ListView), const Offset(0.0, -700.0), speed);
await Future<Null>.delayed(pauses);
await Future<void>.delayed(pauses);
}
// Scroll up
for (int iteration = 0; iteration < maxIterations; iteration += 1) {
debugPrint('Scroll up... $iteration/$maxIterations');
await controller.fling(find.byType(ListView), const Offset(0.0, 300.0), speed);
await Future<Null>.delayed(pauses);
await Future<void>.delayed(pauses);
}
debugPrint('==== MEMORY BENCHMARK ==== DONE ====');