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 type
no 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 type
no setter
id String

Available on Type, provided by the TypePlus extension

The unique id of a type
no setter
isNullable bool

Available on Type, provided by the TypePlus extension

Indicates if this type is nullable
no setter
name String

Available on Type, provided by the TypePlus extension

The name of the type, without any type arguments
no setter
nonNull Type

Available on Type, provided by the TypePlus extension

Returns the non-nullable version of this type
no setter

Methods

implementedBy<T>([Type? t]) bool

Available on Type, provided by the TypePlus extension

Check if a type is implemented by another type
implements<T>([Type? t]) bool

Available on Type, provided by the TypePlus extension

Check if a type implements or extends another type e.g. int implements num, List implements Iterable
provideTo<R>(R fn<U>()) → R

Available on Type, provided by the TypePlus extension

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

Available on Type, provided by the TypePlus extension

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

Available on Type, provided by the TypePlus extension

Constructs a type from a type id
register(TypeProvider provider) → void

Available on Type, provided by the TypePlus extension

Registers a type provider to be used