-
-
Notifications
You must be signed in to change notification settings - Fork 463
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
🐛 Crash when using NavigationView with an unsupported locale #371
Comments
I think this is an expected behavior. Probably For example, when using If you don't you would have similar errors, you can see it below using this code: import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return const MaterialApp(
title: 'Material localization Test',
supportedLocales: [
Locale('fa'),
],
locale: Locale('fa'),
home: MyHomePage(title: 'شمارنده'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key, required this.title}) : super(key: key);
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: TextField(
),
));
}
} That generates the same error:
// cc @bdlukaa |
I believe it should fallback to english, no? |
As far as I know, it doesn't. User locale can be anything. But supported and default locales depends of developer implementation, so everyone must be responsible to add proper implementations for every widget subset (Material, Cupertino, Fluent...) I think we should adhere to the same behaviour of Material or Cupertino, which is in fact the current one. |
@bdlukaa Agree! We can solve this via docs. Great idea 👍🏻 |
Describe the bug
When you set locale to an unsupported language, NavigationView causes a crash.
EDIT: looks like it crashes with same error even when I use English locale.
To Reproduce
Screenshots
Additional context
The text was updated successfully, but these errors were encountered: