getWallets method

  1. @override
Future<List<Wallet>> getWallets({
  1. List<String>? ids,
})
override

Get wallets by id return all if ids is null

Implementation

@override
Future<List<Wallet>> getWallets({List<String>? ids}) async {
  await dbRdy;

  return Future.value(
    _objectBox.store
        .box<DbWallet>()
        .getAll()
        .map((dbWallet) {
          return dbWallet.toNdk();
        })
        .where((wallet) {
          if (ids == null || ids.isEmpty) {
            return true; // return all wallets
          }
          return ids.contains(wallet.id);
        })
        .toList(),
  );
}