runTestableComponent static method

Future<void> runTestableComponent({
  1. required WidgetTester tester,
  2. Iterable<LocalizationsDelegate>? localizationsDelegates,
  3. Iterable<Locale> supportedLocales = const <Locale>[Locale('en', 'US')],
  4. Locale? locale,
  5. required Widget child,
})

Implementation

static Future<void> runTestableComponent(
    {required WidgetTester tester,
    Iterable<LocalizationsDelegate<dynamic>>? localizationsDelegates,
    Iterable<Locale> supportedLocales = const <Locale>[Locale('en', 'US')],
    Locale? locale,
    required Widget child}) async {
  HttpOverrides.global = null;
  await tester.pumpWidget(MaterialApp(
    localizationsDelegates: localizationsDelegates,
    supportedLocales: supportedLocales,
    locale: locale,
    home: Scaffold(body: SafeArea(child: child)),
  ));
}