invokeListMethod<T> method

  1. @override
Future<List<T>> invokeListMethod <T>(
  1. String method,
  2. [dynamic arguments]

An implementation of invokeMethod that can return typed lists.

Dart generics are reified, meaning that an untyped List cannot masquerade as a List. Since invokeMethod can only return dynamic maps, we instead create a new typed list using List.cast.

See also:


Future<List<T>> invokeListMethod<T>(String method, [ dynamic arguments ]) async {
  final List<dynamic> result = await invokeMethod<List<dynamic>>(method, arguments);
  return result.cast<T>();