jeudi 2 mai 2019

In pumpAndSettle() in Flutter, how can I specify timeout without also passing in EnginePhase?

The pumpAndSettle() documentation says that I can pass in a timeout. I do this via:

await tester.pumpAndSettle(Duration(minutes: 11), 
  EnginePhase.sendSemanticsUpdate, 
  Duration(minutes: 12),
);

How do I pass in a timeout without having to also specify the EnginePhase? I just want to use the default EnginePhase.

I tried:

await tester.pumpAndSettle(Duration(minutes: 11), 
  Duration(minutes: 12),
);


await tester.pumpAndSettle([Duration(minutes: 11), 
  Duration(minutes: 12),
]);


await tester.pumpAndSettle(duration: Duration(minutes: 11), 
  timeout: Duration(minutes: 12),
);

await tester.pumpAndSettle(Duration(minutes: 11), 
  timeout: Duration(minutes: 12),
);

What is the name of this syntax, where you have an optional List of inputs in a function? I tried to look it up in Dart syntax but wasn't sure what it was called.

Aucun commentaire:

Enregistrer un commentaire