mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-11-16 17:27:37 +00:00
add YAT popup
This commit is contained in:
parent
66d4b959af
commit
36921fb9c0
2 changed files with 18 additions and 32 deletions
|
@ -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) {
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue