|
@@ -10,7 +10,7 @@ import './views/home.dart';
|
|
|
Future<void> main() async {
|
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
|
SharedPreferences sp = await SharedPreferences.getInstance();
|
|
|
- final String locale = sp.getString('locale') ?? 'en';
|
|
|
+ final String locale = sp.getString('locale') ?? '';
|
|
|
//print(locale);
|
|
|
runApp(MyApp(locale: locale));
|
|
|
}
|
|
@@ -28,7 +28,9 @@ class MyApp extends StatelessWidget {
|
|
|
],
|
|
|
child: Consumer<LanguageChangeController>(
|
|
|
builder: (context, provider, child) {
|
|
|
- provider.changeLanguage(Locale(locale));
|
|
|
+ if (locale.isEmpty) {
|
|
|
+ provider.changeLanguage(const Locale('en'));
|
|
|
+ }
|
|
|
return MaterialApp(
|
|
|
localizationsDelegates: AppLocalizations.localizationsDelegates,
|
|
|
supportedLocales: AppLocalizations.supportedLocales,
|