TypePlus extension
Used to deconstruct a generic type.
- on
Properties
-
args
→ List<
Type> -
Available on Type, provided by the TypePlus extension
The type arguments of a generic typeno setter - base → Type
-
Available on Type, provided by the TypePlus extension
The base type of a generic type, with all type arguments set to dynamic.no setter - baseId → String
-
Available on Type, provided by the TypePlus extension
The base id of a typeno setter - id → String
-
Available on Type, provided by the TypePlus extension
The unique id of a typeno setter - isNullable → bool
-
Available on Type, provided by the TypePlus extension
Indicates if this type is nullableno setter - name → String
-
Available on Type, provided by the TypePlus extension
The name of the type, without any type argumentsno setter - nonNull → Type
-
Available on Type, provided by the TypePlus extension
Returns the non-nullable version of this typeno setter
Methods
-
implementedBy<
T> ([Type? t]) → bool - Check if a type is implemented by another type
-
implements<
T> ([Type? t]) → bool - Check if a type implements or extends another type e.g. int implements num, List implements Iterable
-
provideTo<
R> (R fn< U>() ) → R - Calls the given function with this type provided as the single type argument
Static Methods
-
add<
T> ({String? id, Iterable< Type> ? superTypes}) → void -
Available on Type, provided by the TypePlus extension
Adds a non-generic type, used as a simpler syntax to addFactory -
addFactory(
Function factory, {String? id, Iterable< Function> ? superTypes}) → void - Adds a type factory for any generic or non-generic type @param id: An optional unique id for this type, that will override the default id
-
fromId(
String id) → Type - Constructs a type from a type id
-
register(
TypeProvider provider) → void - Registers a type provider to be used