ease in to using exchange for new users WIP

This commit is contained in:
rehrar 2022-10-24 16:30:38 -06:00
parent a84b7e7c28
commit 844590d10f
2 changed files with 15 additions and 1 deletions

View file

@ -9,6 +9,7 @@ import 'package:stackwallet/models/node_model.dart';
import 'package:stackwallet/models/notification_model.dart';
import 'package:stackwallet/models/trade_wallet_lookup.dart';
import 'package:stackwallet/services/wallets_service.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/logger.dart';
@ -142,6 +143,13 @@ class DB {
_loadSharedCoinCacheBoxes(),
]);
_initialized = true;
if (get(boxName: boxNamePrefs, key: "familiarity") == null) {
await put(boxName: boxNamePrefs, key: "familiarity", value: 0);
}
int count = get(boxName: boxNamePrefs, key: "familiarity") as int;
await put(boxName: boxNamePrefs, key: "familiarity", value: count + 1);
Constants.exchangeForExperiencedUsers(count + 1);
}
}

View file

@ -1,6 +1,7 @@
import 'dart:io';
import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/util.dart';
class _LayoutSizing {
const _LayoutSizing();
@ -14,7 +15,12 @@ class _LayoutSizing {
abstract class Constants {
static const size = _LayoutSizing();
static final bool enableExchange = !Platform.isIOS;
static void exchangeForExperiencedUsers(int count) {
enableExchange =
Util.isDesktop || Platform.isAndroid || count > 5 || !Platform.isIOS;
}
static bool enableExchange = Util.isDesktop || !Platform.isIOS;
//TODO: correct for monero?
static const int satsPerCoinMonero = 1000000000000;