isPresent static method

Future<bool> isPresent(
  1. FlutterDriver? driver,
  2. SerializableFinder finder, {
  3. Duration timeout = const Duration(seconds: 1),
})

Implementation

static Future<bool> isPresent(
  FlutterDriver? driver,
  SerializableFinder finder, {
  Duration timeout = const Duration(seconds: 1),
}) async {
  try {
    await driver?.waitFor(finder, timeout: timeout);
    return true;
  } catch (_) {
    return false;
  }
}