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:
Serhii 2022-08-30 21:03:02 +03:00 committed by GitHub
parent 5fcbf3634b
commit 7fae9cf9bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 189 additions and 19 deletions

View file

@ -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;