invokeMapMethod<K, V> method
An implementation of invokeMethod that can return typed maps.
Dart generics are reified, meaning that an untyped Map<dynamic, dynamic> cannot masquerade as a Map<K, V>. Since invokeMethod can only return dynamic maps, we instead create a new typed map using Map.cast.
See also:
- invokeMethod, which this call delegates to.
Implementation
@override
Future<Map<K, V>> invokeMapMethod<K, V>(String method, [arguments]) {
return _channel.invokeMapMethod(method, arguments) as Future<Map<K, V>>;
}