title: TESTING: No MaterialLocalizations found. AppBar widgets require MaterialLocalizations to be provided
body: <p>When testing a fullscreen widget which contains a Scaffold(), I get this error:</p>
  
  <pre><code>No MaterialLocalizations found.
  AppBar widgets require MaterialLocalizations to be provided by a Localizations widget ancestor.
  </code></pre>
  
  <p>I was trying to inject Localizations widget, but the error remains the same. Any ideas how to proceed testing?</p>
  
  <pre><code>testWidgets('MiniScaffold', (WidgetTester tester) async {
      await tester.pumpWidget(Wrap(child: MiniScaffold()));
      expect(find.text('Hello'), findsOneWidget);
      await tester.pumpWidget(Container());
    });
  
  class MiniScaffold extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return Scaffold(
          appBar: AppBar(
            title: Text('Hello'),
            actions: &lt;Widget&gt;[],
          ),
          body: Container());
    }
  }
  
  class Wrap extends StatelessWidget {
    final Widget child;
  
    const Wrap({Key key, this.child}) : super(key: key);
  
    @override
    Widget build(BuildContext context) {
      return MediaQuery(
          data: new MediaQueryData(),
          child: Localizations(
              locale: Locale('en-US'),
              delegates: [
                DefaultMaterialLocalizations.delegate,
                DefaultWidgetsLocalizations.delegate,
              ],
              child: Directionality(
                textDirection: TextDirection.ltr,
                child: this.child,
              )));
    }
  }
  </code></pre>