title: How to get a localized date string in flutter?
body: <p>In Flutter, how do you get a properly formatted date string that matches the user's (or device's) language setting?</p>
  <p>For example:</p>
  <p>In English a date is commonly written as &quot;<strong>Friday April 10</strong>&quot;, in German it's commonly written as &quot;<strong>Freitag 10. April</strong>&quot;.
  According to the <a href="https://api.flutter.dev/flutter/intl/DateFormat-class.html" rel="nofollow noreferrer">docs</a>, <code>initializeDateFormatting()</code>, must be called to enable localized results from <code>DateFormat</code>. In code this looks like:</p>
  <pre><code>import 'package:flutter/material.dart';
  import 'package:flutter/widgets.dart';
  import 'package:intl/intl.dart';
  import 'package:intl/date_symbol_data_local.dart';
  
  class DateTimeDisplay extends StatefulWidget {
    DateTimeDisplay({Key? key}) : super(key: key);
  
    @override
    _DateTimeDisplay createState() =&gt; _DateTimeDisplay();
  }
  
  class _DateTimeDisplay extends State&lt;DateTimeDisplay&gt; {
    @override
    void initState() {
      super.initState();
  
      initializeDateFormatting().then((_) =&gt; setState(() {}));
    }
  
    @override
    Widget build(BuildContext context) {
      DateTime now = new DateTime.now();
      String dayOfWeek = DateFormat.EEEE().format(now);
      String dayMonth = DateFormat.MMMMd().format(now);
      String year = DateFormat.y().format(now);
  
      return Column(
        crossAxisAlignment: CrossAxisAlignment.stretch,
        children: [
          Text(dayOfWeek, textAlign: TextAlign.center),
          Text(dayMonth, textAlign: TextAlign.center),
          Text(year, textAlign: TextAlign.center),
        ],
      );
    }
  }
  </code></pre>
  <p>The problem is, that <code>DateFormat.EEEE().format(now);</code> always returns the day in English. Same as <code>DateFormat.MMMMd().format(now);</code>, which only replies the English month and date/month order.</p>
  <p>Do you have any ideas what could be wrong here? Or how to convince flutter to return a properly localized date? Your advise is very much appreciated. Thank you.</p>