when import 'package:date_format/date_format.dart Locale Error
kangshibiao123 opened this issue · 5 comments
when import 'package:date_format/date_format.dart'; In the use of internationalization Locale unrecognized
supportedLocales: [
const Locale('en', 'US'), // English
const Locale('he', 'IL'), // Hebrew
// ... other locales the app supports
],
Can't speak English Translation software written
Locales is also not working for me..
I have same issue. In package yo have created locale as abstract class -> Locale of flutter are replaced by package's abstract class Locale and in onther widget like dateTimePicker Locale do not work.
There are two ways to fix this.
- Hide Locale when you import flutter:
import 'flutter' hide Locale;
- Import date_format with a name:
import 'date_format' as dateFmt;
PS: the code present is not accurate but just explain the concept.
In version 2.0.1, I have renamed Locale to DateLocale. Upgrade to 2.0.1.
This issue should not occur when/if you upgrade to 2.0.1