CAKE-356 | added isYatDevMode parameter to the yat_alert.dart; deleted yat_webview_page.dart and yat_view_model.dart; applied localization of Yat to the app

This commit is contained in:
OleksandrSobol 2021-09-16 12:43:43 +03:00
parent 455efeb91f
commit cdddc12c81
24 changed files with 146 additions and 262 deletions

View file

@ -1,5 +1,4 @@
import 'dart:async';
import 'package:cake_wallet/bitcoin/unspent_coins_info.dart';
import 'package:cake_wallet/entities/language_service.dart';
import 'package:cake_wallet/buy/order.dart';
@ -205,10 +204,8 @@ class AppState extends State<App> with SingleTickerProviderStateMixin {
try {
final uri = await getInitialUri();
if (uri == null) {
print('Error: no initial uri');
return;
}
print('got initial uri: $uri');
if (!mounted) return;
_fetchEmojiFromUri(uri, yatStore);
} catch (e) {
@ -221,7 +218,6 @@ class AppState extends State<App> with SingleTickerProviderStateMixin {
if (!kIsWeb) {
stream = getUriLinksStream().listen((Uri uri) {
if (!mounted) return;
print('got uri: $uri');
_fetchEmojiFromUri(uri, yatStore);
}, onError: (Object error) {
if (!mounted) return;
@ -285,53 +281,3 @@ class AppState extends State<App> with SingleTickerProviderStateMixin {
});
}
}
/*class App extends StatelessWidget {
App() {
SystemChrome.setPreferredOrientations(
[DeviceOrientation.portraitUp, DeviceOrientation.portraitDown]);
}
@override
Widget build(BuildContext context) {
return Observer(builder: (BuildContext context) {
final settingsStore = getIt.get<AppStore>().settingsStore;
final statusBarColor = Colors.transparent;
final authenticationStore = getIt.get<AuthenticationStore>();
final initialRoute =
authenticationStore.state == AuthenticationState.denied
? Routes.disclaimer
: Routes.login;
final currentTheme = settingsStore.currentTheme;
final statusBarBrightness = currentTheme.type == ThemeType.dark
? Brightness.light
: Brightness.dark;
final statusBarIconBrightness = currentTheme.type == ThemeType.dark
? Brightness.light
: Brightness.dark;
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
statusBarColor: statusBarColor,
statusBarBrightness: statusBarBrightness,
statusBarIconBrightness: statusBarIconBrightness));
return Root(
authenticationStore: authenticationStore,
navigatorKey: navigatorKey,
child: MaterialApp(
navigatorKey: navigatorKey,
debugShowCheckedModeBanner: false,
theme: settingsStore.theme,
localizationsDelegates: [
S.delegate,
GlobalCupertinoLocalizations.delegate,
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
],
supportedLocales: S.delegate.supportedLocales,
locale: Locale(settingsStore.languageCode),
onGenerateRoute: (settings) => Router.createRoute(settings),
initialRoute: initialRoute,
));
});
}
}*/