isFlutterTest top-level property

bool get isFlutterTest

Should check if kIsWeb is false before checking if this is a test.

Implementation

bool get isFlutterTest {
  assert(() {
    if (kIsWeb) {
      throw FlutterError(
        'The getter `isFlutterTest` should not be used in web',
      );
    }
    return true;
  }());
  return Platform.environment.containsKey('FLUTTER_TEST');
}