-
Notifications
You must be signed in to change notification settings - Fork 27.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with showDatePicker and locale #16304
Comments
We don't provide support for Locale('eu', 'ES') yet, see https://docs.flutter.io/flutter/flutter_localizations/GlobalMaterialLocalizations-class.html The fact that we're not reporting the failure as "no support for locale ..." is a bug, sorry about that. cc @yjbanov |
Thanks, I will keep it in mind |
Locale('ru') is provided, but I've got the same error |
@alexd1971 - can you provide a small example that demos the problem you're seeing with the Russian locale? |
I solved the problem. Everything works |
@alexd1971 i'm facing the same problem with Locale('de') How did you solve it? |
@RiccardoMetaTime Widget build(BuildContext context) {
return new MaterialApp(
title: 'App Title',
localizationsDelegates: [
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
],
supportedLocales: [
const Locale('en', 'US'),
const Locale('ru', 'RU'),
], |
I'm trying to add Russian locale like this:
and get the following error logs:
Can't find anything about this error in the context of Flutter. |
Was able to fix it. The "initializeDateFormatting" function is only needed if "localizationsDelegates" aren't used. They can't work together. |
@andreyvgavrilov, could please a file an issue for us to improve the error message? |
This fix worked for me as well. I had both "initializeDateFormatting" and "localizationsDelegates" active (it worked with Flutter-hot-reload, but not after restarting the app completely). I was following these instructions: https://pub.dartlang.org/documentation/intl/latest/intl/DateFormat-class.html |
@RiccardoMetaTime |
+1 here |
I just to have the same problem and the solution was edit the material_localizations.dart and i got to show spanish text in datepicker |
The problem persists with me, I tried anyway, I need to update to pt_BR, Can someone help me? |
@leonetosoft I was able to use pt_BR, i fix this using this link |
@TeuryBazzo fiz o procedimento conforme o link porém meu aplicativo da erro, pode postar o seu initApp aqui ? por gentileza |
return MaterialApp(
title: 'Flutter Demo',
localizationsDelegates: [
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
],
supportedLocales: [
const Locale('pt'),
],
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(title: 'Demo'),
); and you need update your pubspec.yaml
|
I'm getting some problems when I try to use in Web. I'm receiving the error "Unable to find modules for some sources...' when I try to import flutter_localizations. |
Hi @asierf Code Sample
and make sure you've
Closing, as this isn't an issue with Flutter itself, |
Every time I call its rebuild my Whole Widget. Can anyOne help me? Future showDateDialog(BuildContext context) async { } |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Steps to Reproduce
I've tried to open a DatePicker with differents Locale instances but is not working using eu_ES.
Logs
Flutter Doctor
The text was updated successfully, but these errors were encountered: