expectLater function Null safety

Future<void> expectLater(
  1. dynamic actual,
  2. dynamic matcher,
  3. {String? reason,
  4. dynamic skip}

Just like expect, but returns a Future that completes when the matcher has finished matching.

See test_package.expectLater for details.

If the matcher fails asynchronously, that failure is piped to the returned future where it can be handled by user code. If it is not handled by user code, the test will fail.


Future<void> expectLater(
  dynamic actual,
  dynamic matcher, {
  String? reason,
  dynamic skip, // true or a String
}) {
  // We can't wrap the delegate in a guard, or we'll hit async barriers in
  // [TestWidgetsFlutterBinding] while we're waiting for the matcher to complete
  return test_package.expectLater(actual, matcher, reason: reason, skip: skip)
           .then<void>((dynamic value) => null);