cake_wallet/lib/store/anonpay/anonpay_transactions_store.dart
Godwin Asuquo 3006679560
Cw 314 trocador receive screen update (#823)
* Change receive screen ui

* Upgrade flutter packages

* revert Upgrade flutter packages

* revert Upgrade flutter packages

* Adjust flow for anon invoice page navigation

* Add receive screen ui

* Implement anonpay invoice

* Add invoice detail to transactions page

* Implement donation link

* Fix transaction filter and details view

* Save donation link

* Fix transaction display issues

* Fix formatting

* Fix merge conflict

* Fix localization

* Fix transaction amount display

* Fix transaction limit for fiat

* Update fix from code review

* Fix issues from code review

* Make amountTo nullable to avoid potential

* Remove encoding for description in donation link

* Remove optional params from request

* Fix QR image version

* Refactor QRCode, fix issues from code review

* Pass version to QRCode full page

---------

Co-authored-by: OmarHatem <omarh.ismail1@gmail.com>
2023-03-24 17:26:42 +02:00

34 lines
1 KiB
Dart

import 'dart:async';
import 'package:cake_wallet/anonpay/anonpay_invoice_info.dart';
import 'package:cake_wallet/view_model/dashboard/anonpay_transaction_list_item.dart';
import 'package:hive/hive.dart';
import 'package:mobx/mobx.dart';
part 'anonpay_transactions_store.g.dart';
class AnonpayTransactionsStore = AnonpayTransactionsStoreBase with _$AnonpayTransactionsStore;
abstract class AnonpayTransactionsStoreBase with Store {
AnonpayTransactionsStoreBase({
required this.anonpayInvoiceInfoSource,
}) : transactions = <AnonpayTransactionListItem>[] {
anonpayInvoiceInfoSource.watch().listen(
(_) async => await updateTransactionList(),
);
updateTransactionList();
}
Box<AnonpayInvoiceInfo> anonpayInvoiceInfoSource;
@observable
List<AnonpayTransactionListItem> transactions;
@action
Future<void> updateTransactionList() async {
transactions = anonpayInvoiceInfoSource.values
.map(
(transaction) => AnonpayTransactionListItem(transaction: transaction),
)
.toList();
}
}