TypeReflection<T> class

Dart Type reflection.

Available extensions

Constructors

TypeReflection(Type type, [List<Object>? arguments])
const
TypeReflection.from(Object o)
factory

Properties

arguments List<TypeReflection>
Returns the arguments of this type. Example: Map<String, int> will return [String, int].
no setter
argumentsAsTypeInfo List<TypeInfo>
Returns the arguments of this type as TypeInfo.
no setter
argumentsLength int
Returns the arguments length.
no setter
hasArguments bool
Returns true if this type has arguments.
no setter
hashCode int
The hash code for this object.
no setteroverride
isBasicType bool
Returns true if type isPrimitiveType or isCollection.
no setter
isBigInt bool
Returns true if type is BigInt.
no setter
isBoolType bool
Returns true if type is bool.
no setter
isCollectionType bool
Returns true if type is a collection (List, Iterable, Map or Set).
no setter
isDoubleType bool
Returns true if type is double.
no setter
isDynamicType bool
Returns true if type is dynamic.
no setter
isEntityType bool
Returns true if type can be an entity (![isObjectOrDynamicType] && ![isBasicType]).
no setter
isIntType bool
Returns true if type is int.
no setter
isIterableEntity bool
Returns true if type isIterableType of entities.
no setter
isIterableType bool
Returns true if type is Iterable.
no setter
isListEntity bool
Returns true if type is a List of entities.
no setter
isListType bool
Returns true if type is a List.
no setter
isMapType bool
Returns true if type is Map.
no setter
isNumberType bool
Returns true if type is int, double or num.
no setter
isNumericType bool
Returns true if type is int, double, num or BigInt. See isNumberType and isBigInt
no setter
isNumType bool
Returns true if type is num.
no setter
isObjectOrDynamicType bool
Returns true if type is Object or dynamic.
no setter
isObjectType bool
Returns true if type is Object.
no setter
isPrimitiveType bool
Returns true if type is String, int, double, num or bool.
no setter
isSetType bool
Returns true if type is a Set.
no setter
isStringType bool
Returns true if type is String.
no setter
listEntityType TypeReflection?
The TypeReflection of the List elements type.
no setter
listType TypeReflection?
The TypeReflection of the List elements type.
no setter
mapKeyType TypeReflection?
The TypeReflection of the Map key type.
no setter
mapValueType TypeReflection?
The TypeReflection of the Map value type.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type Type
The Dart Type.
final
typeInfo TypeInfo
Returns a TypeInfo of this instance.
no setter
typeName String
Returns the type name.
no setter

Methods

equalsArgumentsTypes(List<Type> types) bool
Returns true if arguments have equals types.
isOfType(Type type, [List<Type>? arguments]) bool
Returns true if the parameter type is equals to field type.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

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

Static Properties

tVoid TypeReflection<void>
final

Static Methods

getConstantName(String typeName, [List<String> args = const <String>[]]) String?
toList(Iterable<Object> list, {bool growable = false}) List<TypeReflection>

Constants

tBigInt → const TypeReflection<BigInt>
tBool → const TypeReflection<bool>
tDouble → const TypeReflection<double>
tDynamic → const TypeReflection
tFunction → const TypeReflection<Function>
tFuture → const TypeReflection<Future>
tFutureBool → const TypeReflection<Future<bool>>
tFutureDynamic → const TypeReflection<Future>
tFutureInt → const TypeReflection<Future<int>>
tFutureObject → const TypeReflection<Future<Object>>
tFutureOr → const TypeReflection<FutureOr>
tFutureOrBool → const TypeReflection<FutureOr<bool>>
tFutureOrDynamic → const TypeReflection<FutureOr>
tFutureOrInt → const TypeReflection<FutureOr<int>>
tFutureOrObject → const TypeReflection<FutureOr<Object>>
tFutureOrString → const TypeReflection<FutureOr<String>>
tFutureString → const TypeReflection<Future<String>>
tInt → const TypeReflection<int>
tList → const TypeReflection<List>
tListBool → const TypeReflection<List<bool>>
tListDouble → const TypeReflection<List<double>>
tListDynamic → const TypeReflection<List>
tListInt → const TypeReflection<List<int>>
tListNum → const TypeReflection<List<num>>
tListObject → const TypeReflection<List<Object>>
tListString → const TypeReflection<List<String>>
tMap → const TypeReflection<Map>
tMapObjectObject → const TypeReflection<Map<Object, Object>>
tMapStringDynamic → const TypeReflection<Map<String, dynamic>>
tMapStringObject → const TypeReflection<Map<String, Object>>
tMapStringString → const TypeReflection<Map<String, String>>
tNum → const TypeReflection<num>
tObject → const TypeReflection<Object>
tSet → const TypeReflection<Set>
tSetDynamic → const TypeReflection<Set>
tSetInt → const TypeReflection<Set<int>>
tSetObject → const TypeReflection<Set<Object>>
tSetString → const TypeReflection<Set<String>>
tString → const TypeReflection<String>