makeCustomCall<T> method

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

Implementation

Future<T> makeCustomCall<T>(
  String function, [
  List<dynamic>? params,
]) async {
  try {
    final data = await rpc.call(function, params);

    // ignore: only_throw_errors
    if (data is Error || data is Exception) throw data;

    return data.result as T;
    // ignore: avoid_catches_without_on_clauses
  } catch (e) {
    rethrow;
  }
}