extractMapTypeArguments function

Object? extractMapTypeArguments(
  1. Map map,
  2. Object? extract<K, V>()
)

Given a Map, invokes extract, passing the map's key and value type arguments as the type arguments to the generic function.

Example:

class Two<A, B> {}

main() {
  Object map = <String, int>{};
  print(extractMapTypeArguments(map, <K, V>() => new Two<K, V>());
  // Prints "Instance of 'Two<String, int>'".
}

Implementation

Object? extractMapTypeArguments(Map map, Object? Function<K, V>() extract) =>
    internal.extractTypeArguments<Map>(map, extract);