forType<C> static method
Creates a Class instance for a runtime type.
Type Parameters:
Type
: The class type to reflect
Parameters:
domain
: Optional protection domainpackage
: Optional package name to search with
Returns:
- A Class instance for the type
Example:
final listClass = Class.forType(List<String>);
Implementation
static Class<C> forType<C>(C type, [ProtectionDomain? domain, String? package]) {
return _Class<C>(type.toString(), domain ?? ProtectionDomain.current(), package);
}