readTransactions method

Future<void> readTransactions({
  1. bool more = false,
})

Implementation

Future<void> readTransactions({bool more = false}) async {
  if (!more) {
    txnsCursor = null;
    txns.clear();
  }
  txnsState.loading();
  await UServices.gold.readTransactions(
    p: UGoldReadTransactionsParams(cursor: txnsCursor, limit: pageSize),
    onOk: (UResponse<UGoldTransactionListResponse> r) {
      txns.addAll(r.result?.items ?? <UGoldTransactionResponse>[]);
      txnsCursor = r.result?.nextCursor;
      txns.isEmpty ? txnsState.emptying() : txnsState.loaded();
    },
    onError: (UEmptyResponse e) => txnsState.error(),
    onException: (String e) => txnsState.error(),
  );
}