SharedChecker<_SiblingModel extends Model> class
A utility to legibly assert a DartType
against core types
Optionally declare a model to discover "sibling" models, or models that share
the same domain or provider (e.g. SqliteModel
).
Constructors
Properties
- argType → DartType
-
Retrieves type argument, i.e.
Type
inFuture<Type>
orList<Type>
no setter - asPrimitive → Type
-
no setter
- canSerializeArgType → bool
-
no setter
- fromJsonConstructor → ConstructorElement?
-
Retrieves the
fromJson
factory element. If the constructor can't be found,null
is returned.no setter - hashCode → int
-
The hash code for this object.
no setterinherited
- isArgTypeAFuture → bool
-
no setter
- isArgTypeASibling → bool
-
If the sub type has super type
SqliteModel
Returns true forFuture<SqliteModel>
,List<Future<SqliteModel>>
, andList<SqliteModel>
.no setter - isBool → bool
-
no setter
- isDartCoreType → bool
-
If this is a bool, DateTime, double, int, num, or String
no setter
- isDateTime → bool
-
no setter
- isDouble → bool
-
no setter
- isEnum → bool
-
no setter
- isFuture → bool
-
no setter
- isInt → bool
-
no setter
- isIterable → bool
-
no setter
- isList → bool
-
no setter
- isMap → bool
-
no setter
- isNullable → bool
-
no setter
- isNum → bool
-
no setter
- isSerializable → bool
-
Not all Types are parseable. For consistency, one catchall before smaller checks
no setter
- isSet → bool
-
no setter
- isSibling → bool
-
If this is a class similarly annotated by the current generator.
no setter
- isString → bool
-
no setter
- isUnFuturedTypeNullable → bool
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
superClassTypeArgs
→ List<
DartType> -
The arguments passed to a super class definition.
For example, a field
final Currency amount
with a type definitionclass Currency extends OfflineFirstSerdes<T, X, Y> {}
would return[T, X, Y]
.no setter - targetType → DartType
-
The checked type
final
- toJsonMethod → MethodElement?
-
Retrieves the
toJson
method element. If the method can't be found,null
is returned.no setter -
typeArguments
→ List<
DartType> ? -
Returns type arguments of targetType. For example, given
Map<Key, Value>
,[Key, Value]
is returned. If the targetType does not declare type arguments, return isnull
.no setter - unFuturedArgType → DartType
-
argType without
Future
if it is aFuture
.no setter - unFuturedType → DartType
-
targetType without
Future
if it is aFuture
no setter - withoutNullResultType → String
-
Returns the final version of a type without decoration. It will not have a null suffix.
no setter
Methods
-
enumDeserializeFactory(
String providerName) → String? -
enumSerializeMethod(
String providerName) → String? -
isSerializableViaJson(
bool doesDeserialize) → bool -
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.
inherited
Static Methods
-
typeOfFuture<
_SiblingModel extends Model> (DartType type) → DartType? - Destructs a type to determine the bottom type after going through Futures and Iterables.
-
withoutNullability(
DartType type) → String -
Print the
DartType
without nullability