TypeChecker.typeNamed takes a Type object but only relies on its toString value. I need to build TypeCheckers for packages that aren’t project dependencies, so having a variant that accepts a type name as a String would be far more practical. I’ve implemented a workaround class, but this really should be supported natively.
The workaround:
/// Create a Type class who's toString() method returns the name
///
/// Workaround for TypeChecker.typeNamed() not accepting a String.
class TypeNamed implements Type {
/// The name of the type
final String name;
/// Constructor
const TypeNamed(this.name);
@override
String toString() => name;
}