Fixes for monero only app version.

This commit is contained in:
M
2021-12-30 19:20:00 +02:00
parent 4535a1aaa8
commit 226d546d55
25 changed files with 176 additions and 102 deletions
+29 -26
View File
@@ -26,6 +26,7 @@ import 'package:cake_wallet/main.dart';
import 'package:cake_wallet/router.dart';
import 'package:cake_wallet/buy/moonpay/moonpay_buy_provider.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:cake_wallet/wallet_type_utils.dart';
class DashboardPage extends BasePage {
DashboardPage({
@@ -144,17 +145,19 @@ class DashboardPage extends BasePage {
image: exchangeImage,
title: S.of(context).exchange,
route: Routes.exchange),
ActionButton(
image: buyImage,
title: S.of(context).buy,
onClick: () async =>
await _onClickBuyButton(context),
),
ActionButton(
image: sellImage,
title: 'Sell',
onClick: () async =>
await _onClickSellButton(context),
if (isMoneroOnly)
ActionButton(
image: buyImage,
title: S.of(context).buy,
onClick: () async =>
await _onClickBuyButton(context),
),
if (isMoneroOnly)
ActionButton(
image: sellImage,
title: 'Sell',
onClick: () async =>
await _onClickSellButton(context),
),
],
),
@@ -174,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) {
+8 -6
View File
@@ -6,6 +6,7 @@ import 'package:cake_wallet/routes.dart';
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/src/screens/auth/auth_page.dart';
import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
import 'package:cake_wallet/wallet_type_utils.dart';
// FIXME: terrible design
@@ -37,12 +38,13 @@ class WalletMenu {
title: S.current.address_book_menu,
image: Image.asset('assets/images/open_book_menu.png',
height: 16, width: 16)),
WalletMenuItem(
title: S.current.backup,
image: Image.asset('assets/images/restore_wallet.png',
height: 16,
width: 16,
color: Palette.darkBlue)),
if(!isMonerOnly)
WalletMenuItem(
title: S.current.backup,
image: Image.asset('assets/images/restore_wallet.png',
height: 16,
width: 16,
color: Palette.darkBlue)),
WalletMenuItem(
title: S.current.settings_title,
image: Image.asset('assets/images/settings_menu.png',
@@ -15,6 +15,7 @@ import 'package:cake_wallet/src/widgets/primary_button.dart';
import 'package:cake_wallet/src/screens/base_page.dart';
import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
import 'package:flutter_slidable/flutter_slidable.dart';
import 'package:cake_wallet/wallet_type_utils.dart';
class WalletListPage extends BasePage {
WalletListPage({this.walletListViewModel});
@@ -181,8 +182,17 @@ class WalletListBodyState extends State<WalletListBody> {
),
SizedBox(height: 10.0),
PrimaryImageButton(
onPressed: () =>
Navigator.of(context).pushNamed(Routes.restoreWalletType),
onPressed: () {
if (isMoneroOnly) {
Navigator
.of(context)
.pushNamed(
Routes.restoreWallet,
arguments: widget.walletListViewModel.currentWalletType);
} else {
Navigator.of(context).pushNamed(Routes.restoreWalletType);
}
},
image: restoreWalletImage,
text: S.of(context).wallet_list_restore_wallet,
color: Theme.of(context).accentTextTheme.caption.color,
+15 -9
View File
@@ -4,6 +4,7 @@ import 'package:cake_wallet/routes.dart';
import 'package:cake_wallet/src/widgets/primary_button.dart';
import 'package:cake_wallet/src/screens/base_page.dart';
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/wallet_type_utils.dart';
class WelcomePage extends BasePage {
static const aspectRatioImage = 1.25;
@@ -82,9 +83,9 @@ class WelcomePage extends BasePage {
Padding(
padding: EdgeInsets.only(top: 5),
child: Text(
S
.of(context)
.cake_wallet,
isMoneroOnly
? S.of(context).monero_com
: S.of(context).cake_wallet,
style: TextStyle(
fontSize: 36,
fontWeight: FontWeight.bold,
@@ -100,9 +101,9 @@ class WelcomePage extends BasePage {
Padding(
padding: EdgeInsets.only(top: 5),
child: Text(
S
.of(context)
.first_wallet_text,
isMoneroOnly
? S.of(context).monero_com_wallet_text
: S.of(context).first_wallet_text,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
@@ -159,9 +160,14 @@ class WelcomePage extends BasePage {
Padding(
padding: EdgeInsets.only(top: 10),
child: PrimaryImageButton(
onPressed: () =>
Navigator.pushNamed(context,
Routes.restoreOptions),
onPressed: () {
if (isMoneroOnly) {
Navigator.of(context).pushNamed(Routes.moneroRestoreWalletFromWelcome);
} else {
Navigator.pushNamed(context,
Routes.restoreOptions);
}
},
image: restoreWalletImage,
text: S
.of(context)