From 36921fb9c0f10b5d5fd98ed2a49b003ae8498bf2 Mon Sep 17 00:00:00 2001 From: Godwin Asuquo Date: Tue, 8 Feb 2022 07:00:07 +0100 Subject: [PATCH] add YAT popup --- lib/src/screens/dashboard/dashboard_page.dart | 31 ++++++++++--------- lib/src/screens/yat/yat_popup.dart | 19 ++---------- 2 files changed, 18 insertions(+), 32 deletions(-) diff --git a/lib/src/screens/dashboard/dashboard_page.dart b/lib/src/screens/dashboard/dashboard_page.dart index 4be30173e..fa43a9a6a 100644 --- a/lib/src/screens/dashboard/dashboard_page.dart +++ b/lib/src/screens/dashboard/dashboard_page.dart @@ -165,6 +165,7 @@ class DashboardPage extends BasePage { } void _setEffects(BuildContext context) async { + print('At the begins of the opening'); if (_isEffectsInstalled) { return; } @@ -176,23 +177,23 @@ class DashboardPage extends BasePage { pages.add(TransactionsPage(dashboardViewModel: walletViewModel)); _isEffectsInstalled = true; - //if (walletViewModel.shouldShowYatPopup) { - // await Future.delayed(Duration(seconds: 1)); + if (walletViewModel.shouldShowYatPopup) { + await Future.delayed(Duration(seconds: 1)); - // if (currentRouteSettings.name == Routes.preSeed - // || currentRouteSettings.name == Routes.seed) { - // return; - // } + if (currentRouteSettings.name == Routes.preSeed + || currentRouteSettings.name == Routes.seed) { + return; + } - // await showPopUp( - // context: context, - // builder: (BuildContext context) { - // return YatPopup( - // dashboardViewModel: walletViewModel, - // onClose: () => Navigator.of(context).pop()); - // }); - // walletViewModel.furtherShowYatPopup(false); - //} + await showPopUp( + context: context, + builder: (BuildContext context) { + return YatPopup( + dashboardViewModel: walletViewModel, + onClose: () => Navigator.of(context).pop()); + }); + walletViewModel.furtherShowYatPopup(false); + } autorun((_) async { if (!walletViewModel.isOutdatedElectrumWallet) { diff --git a/lib/src/screens/yat/yat_popup.dart b/lib/src/screens/yat/yat_popup.dart index ade63d956..c37075639 100644 --- a/lib/src/screens/yat/yat_popup.dart +++ b/lib/src/screens/yat/yat_popup.dart @@ -10,7 +10,6 @@ import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart'; import 'package:flutter/material.dart'; import 'package:animate_do/animate_do.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; -import 'package:url_launcher/url_launcher.dart'; import 'package:cake_wallet/generated/i18n.dart'; class YatPopup extends StatelessWidget { @@ -160,24 +159,10 @@ class YatPopup extends StatelessWidget { child: ThirdIntroduction( onClose: onClose, onGet: () { - var createNewYatUrl = YatLink.startFlowUrl; - final createNewYatUrlParameters = dashboardViewModel. - yatStore.defineQueryParameters(); - - if (createNewYatUrlParameters.isNotEmpty) { - createNewYatUrl += '?sub1=' + createNewYatUrlParameters; - } - - launch(createNewYatUrl, forceSafariVC: false); + }, onConnect: () { - String url = baseUrl + YatLink.signInSuffix; - final parameters = dashboardViewModel - .yatStore.defineQueryParameters(); - if (parameters.isNotEmpty) { - url += YatLink.queryParameter + parameters; - } - launch(url, forceSafariVC: false); + } )) : Container()