isStreamOrAsyncStream function
Implementation
bool isStreamOrAsyncStream(DartType type) {
DartType _type = type;
if (type is ParameterizedType &&
type.typeArguments.isNotEmpty &&
(type.isDartAsyncFuture || type.isDartAsyncFutureOr)) {
_type = type.typeArguments[0];
}
return const TypeChecker.fromRuntime(Stream).isAssignableFromType(_type);
}