diff --git a/lib/app/view/app.dart b/lib/app/view/app.dart index 7835f47ea..069ce5fb1 100644 --- a/lib/app/view/app.dart +++ b/lib/app/view/app.dart @@ -16,7 +16,7 @@ import 'package:ente_auth/ui/home_page.dart'; import 'package:ente_auth/ui/settings/app_update_dialog.dart'; import 'package:flutter/foundation.dart'; import "package:flutter/material.dart"; -import "package:flutter_localizations/flutter_localizations.dart"; +import 'package:flutter_localizations/flutter_localizations.dart'; class App extends StatefulWidget { const App({Key key}); @@ -79,9 +79,14 @@ class _AppState extends State { theme: lightTheme, darkTheme: dartTheme, debugShowCheckedModeBanner: false, - supportedLocales: supportedLocales, + supportedLocales: appSupportedLocales, localeListResolutionCallback: localResolutionCallBack, - localizationsDelegates: AppLocalizations.localizationsDelegates, + localizationsDelegates: const [ + AppLocalizations.delegate, + GlobalMaterialLocalizations.delegate, + GlobalCupertinoLocalizations.delegate, + GlobalWidgetsLocalizations.delegate, + ], routes: _getRoutes, ), ); @@ -92,7 +97,7 @@ class _AppState extends State { theme: lightThemeData, darkTheme: darkThemeData, debugShowCheckedModeBanner: false, - supportedLocales: supportedLocales, + supportedLocales: appSupportedLocales, localeListResolutionCallback: localResolutionCallBack, localizationsDelegates: const [ AppLocalizations.delegate, diff --git a/lib/locale.dart b/lib/locale.dart index 108144499..f80090cfc 100644 --- a/lib/locale.dart +++ b/lib/locale.dart @@ -3,13 +3,13 @@ import 'dart:ui'; // list of locales which are enabled for auth app. // Add more language to the list only when at least 90% of the strings are // translated in the corresponding language. -const List supportedLocales = [ +const List appSupportedLocales = [ Locale('en'), ]; Locale localResolutionCallBack(locales, supportedLocales) { for (Locale locale in locales) { - if (supportedLocales.contains(locale)) { + if (appSupportedLocales.contains(locale)) { return locale; } } diff --git a/lib/ui/account/change_email_dialog.dart b/lib/ui/account/change_email_dialog.dart index ce505ff7a..7cfa10f4a 100644 --- a/lib/ui/account/change_email_dialog.dart +++ b/lib/ui/account/change_email_dialog.dart @@ -1,5 +1,3 @@ -// @dart=2.9 - import 'package:ente_auth/l10n/l10n.dart'; import 'package:ente_auth/services/user_service.dart'; import 'package:ente_auth/utils/dialog_util.dart'; @@ -7,14 +5,14 @@ import 'package:ente_auth/utils/email_util.dart'; import 'package:flutter/material.dart'; class ChangeEmailDialog extends StatefulWidget { - const ChangeEmailDialog({Key key}) : super(key: key); + const ChangeEmailDialog({Key? key}) : super(key: key); @override State createState() => _ChangeEmailDialogState(); } class _ChangeEmailDialogState extends State { - String _email; + String _email = ""; @override Widget build(BuildContext context) { diff --git a/lib/ui/tools/app_lock.dart b/lib/ui/tools/app_lock.dart index bcba632a2..ebafdb106 100644 --- a/lib/ui/tools/app_lock.dart +++ b/lib/ui/tools/app_lock.dart @@ -2,8 +2,10 @@ import 'dart:async'; +import 'package:ente_auth/l10n/l10n.dart'; import 'package:ente_auth/locale.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_localizations/flutter_localizations.dart'; /// A widget which handles app lifecycle events for showing and hiding a lock screen. /// This should wrap around a `MyApp` widget (or equivalent). @@ -108,8 +110,14 @@ class _AppLockState extends State with WidgetsBindingObserver { themeMode: ThemeMode.system, theme: widget.lightTheme, darkTheme: widget.darkTheme, - supportedLocales: supportedLocales, + supportedLocales: appSupportedLocales, localeListResolutionCallback: localResolutionCallBack, + localizationsDelegates: const [ + AppLocalizations.delegate, + GlobalMaterialLocalizations.delegate, + GlobalCupertinoLocalizations.delegate, + GlobalWidgetsLocalizations.delegate, + ], onGenerateRoute: (settings) { switch (settings.name) { case '/lock-screen': diff --git a/pubspec.yaml b/pubspec.yaml index 35d89c94d..74f1fb0e4 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: ente_auth description: ente two-factor authenticator -version: 1.0.30+30 +version: 1.0.31+31 publish_to: none environment: