mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 12:29:51 +00:00
Cw 150 cake pay introduction card (#486)
* create introducing card * add ability to close the card * update walletInfo class * update localization * fix intro text * fix card size * show card for existing and new wallet types * disable card for haven wallets * fixes to PR * fixes to PR * fix PR
This commit is contained in:
parent
5fcbf3634b
commit
7fae9cf9bb
21 changed files with 189 additions and 19 deletions
|
@ -9,7 +9,7 @@ part 'wallet_info.g.dart';
|
|||
class WalletInfo extends HiveObject {
|
||||
WalletInfo(this.id, this.name, this.type, this.isRecovery, this.restoreHeight,
|
||||
this.timestamp, this.dirPath, this.path, this.address, this.yatEid,
|
||||
this.yatLastUsedAddressRaw)
|
||||
this.yatLastUsedAddressRaw, this.showIntroCakePayCard)
|
||||
: _yatLastUsedAddressController = StreamController<String>.broadcast();
|
||||
|
||||
factory WalletInfo.external(
|
||||
|
@ -23,10 +23,11 @@ class WalletInfo extends HiveObject {
|
|||
@required String path,
|
||||
@required String address,
|
||||
String yatEid ='',
|
||||
String yatLastUsedAddressRaw = ''}) {
|
||||
String yatLastUsedAddressRaw = '',
|
||||
bool showIntroCakePayCard}) {
|
||||
return WalletInfo(id, name, type, isRecovery, restoreHeight,
|
||||
date.millisecondsSinceEpoch ?? 0, dirPath, path, address,
|
||||
yatEid, yatLastUsedAddressRaw);
|
||||
yatEid, yatLastUsedAddressRaw, showIntroCakePayCard);
|
||||
}
|
||||
|
||||
static const typeId = 4;
|
||||
|
@ -68,6 +69,9 @@ class WalletInfo extends HiveObject {
|
|||
@HiveField(12)
|
||||
String yatLastUsedAddressRaw;
|
||||
|
||||
@HiveField(13)
|
||||
bool showIntroCakePayCard;
|
||||
|
||||
String get yatLastUsedAddress => yatLastUsedAddressRaw;
|
||||
|
||||
set yatLastUsedAddress(String address) {
|
||||
|
@ -77,6 +81,13 @@ class WalletInfo extends HiveObject {
|
|||
|
||||
String get yatEmojiId => yatEid ?? '';
|
||||
|
||||
bool get isShowIntroCakePayCard {
|
||||
if(showIntroCakePayCard == null) {
|
||||
return type != WalletType.haven;
|
||||
}
|
||||
return showIntroCakePayCard;
|
||||
}
|
||||
|
||||
DateTime get date => DateTime.fromMillisecondsSinceEpoch(timestamp);
|
||||
|
||||
Stream<String> get yatLastUsedAddressStream => _yatLastUsedAddressController.stream;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue