extractIterableTypeArgument function
Given an Iterable, invokes extract
, passing the iterable
's type
argument as the type argument to the generic function.
Example:
Object iterable = <int>[];
print(extractIterableTypeArgument(iterable, <T>() => new Set<T>());
// Prints "Instance of 'Set<int>'".
Implementation
Object? extractIterableTypeArgument(
Iterable iterable, Object? Function<T>() extract) =>
internal.extractTypeArguments<Iterable>(iterable, extract);