utils/value_utils library

Extensions

CvBasicTypeExt on Type
Basic type extension definition.

Functions

basicTypeCast<T extends Object?>(Object? value) → T?
Handle int, num, double, String, bool
basicTypeCastType(Type type, Object? value) Object?
Handle int, num, double, String, bool
basicTypeToBool(Object? value) bool?
parse any bool or parse as null num
basicTypeToDouble(Object? value) double?
parse any double or parse as int
basicTypeToInt(Object? value) int?
true as 1, false as 0, null as null, rounded to int
basicTypeToNum(Object? value) num?
num or int or parse string
isBasicTypeOrNull(dynamic value) bool
True for null, num, String, bool