title: Requested the Locale of a context that does not include a Localizations ancestor
body: <p>I am trying to get the <code>Locale</code> of the user's phone at app start.</p>
  <p>I have this <code>Widget</code> tree in the <code>runApp()</code> method :</p>
  <pre><code>@override
    Widget build(BuildContext context) {
      return MaterialApp(
              locale: Locale(Localizations.localeOf(context).languageCode), // This crashes
              localizationsDelegates: [
                const LocalizationDelegate(), // My custom delegate to get translations
                CountryLocalizations.delegate,
                GlobalMaterialLocalizations.delegate,
                GlobalWidgetsLocalizations.delegate,
              ],
              supportedLocales: [
                Locale(&quot;en&quot;),
                Locale(&quot;fr&quot;),
              ],
              debugShowCheckedModeBanner: false,
              home: Scaffold(
                resizeToAvoidBottomInset: false,
                body: HomePage(),
              )
          );
  }
  </code></pre>
  <p>the line <code>locale: Locale(Localizations.localeOf(context).languageCode)</code> cause a crash with :</p>
  <pre><code>Requested the Locale of a context that does not include a Localizations ancestor.
  </code></pre>
  <p>I simply want to bind this locale to my <code>Delegate</code> without going further in app.<br />
  So far, i put <code>locale: Locale(&quot;en&quot;)</code> to read my <code>en.json</code> file from my <code>LocalizationDelegate</code>.</p>