makeTypedListRpcCall<T> method

Future<List<T>> makeTypedListRpcCall<T>(
  1. String method, [
  2. List? params
])

Implementation

Future<List<T>> makeTypedListRpcCall<T>(
  String method, [
  List<dynamic>? params,
]) async {
  final result = await makeRpcCall(method, params);
  if (result == null) return <T>[];

  if (result is! List) {
    throw Exception('Rpc result $result is not of type List');
  }
  return result.map((e) => typeFactory<T>(e)).toList();
}