cld top-level property

CommonLocaleData cld
getter/setter pair

A global variable to conveniently retrieve the Common Data from any part of your app. This variable should be set by your code to the correct locale.

Example:

   void main() {
     // Hardcode to French
     cld = CommonLocaleData.fr;

     // If your app support several languages, dynamically choose the language you want
     var currentLanguage = ui.window.locale.languageCode;
     cld = const {
       'en': CommonLocaleData.en,
       'fr': CommonLocaleData.fr,
     }[currentLanguage] ?? CommonLocaleData.en;

Implementation

CommonLocaleData cld = CommonLocaleData.en;