add YAT popup

This commit is contained in:
Godwin Asuquo 2022-02-08 07:00:07 +01:00
parent 66d4b959af
commit 36921fb9c0
2 changed files with 18 additions and 32 deletions

View file

@ -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<void>.delayed(Duration(seconds: 1));
if (walletViewModel.shouldShowYatPopup) {
await Future<void>.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<void>(
// context: context,
// builder: (BuildContext context) {
// return YatPopup(
// dashboardViewModel: walletViewModel,
// onClose: () => Navigator.of(context).pop());
// });
// walletViewModel.furtherShowYatPopup(false);
//}
await showPopUp<void>(
context: context,
builder: (BuildContext context) {
return YatPopup(
dashboardViewModel: walletViewModel,
onClose: () => Navigator.of(context).pop());
});
walletViewModel.furtherShowYatPopup(false);
}
autorun((_) async {
if (!walletViewModel.isOutdatedElectrumWallet) {

View file

@ -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()