getAccountById method

  1. @override
Future<AccountV1?> getAccountById(
  1. String? correlationId,
  2. String id
)
override

Gets an account by its unique id.

  • correlationId (optional) transaction id to trace execution through call chain.
  • id an id of account to be retrieved. Return Future that receives account or error.

Implementation

@override
Future<AccountV1?> getAccountById(String? correlationId, String id) async {
  var accounts = _accounts.where((x) {
    return x.id == id;
  }).toList();
  var account = accounts.isNotEmpty ? accounts[0] : null;

  return account;
}