TypeCheck<T> class

A utility class for checking type parameters.

Constructors

TypeCheck()
const

Properties

hashCode int
The hash code for this object.
no setteroverride
isIterable bool
Checks if T is an Iterable of any type.
no setter
isList bool
Checks if T is a List of any type.
no setter
isMap bool
Checks if T is a Map of any type.
no setter
isNullable bool
Checks if T is nullable.
no setter
name String
Returns the name of the T.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
toIterable TypeCheck<Iterable<T>>
Returns a TypeCheck object for type Iterable<T>.
no setter
toList TypeCheck<List<T>>
Returns a TypeCheck object for type List<T>.
no setter
toNullable TypeCheck<T?>
Returns a TypeCheck object for type T?.
no setter

Methods

isExact<TOther>() bool
Returns true if TOther is exactly T.
isListOf<E>() bool
Checks if T is a List of type List<E>.
isMapOf<K, V>() bool
Checks if T is a List of type Map<K, V>.
isSubtypeOf<TSuper>() bool
Returns true if instance of T is applicable to TSuper, as if you would check new T() is TSuper.
isSupertypeOf<TSub>() bool
Returns true if instance of TSub is applicable to T, as if you would check new TSub() is T.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override