TypeCoercer class
Type coercion utility for parsing values.
Constructors
- TypeCoercer(TypeCoercionRules rules)
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- rules → TypeCoercionRules
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
coerce<
T> (dynamic value, {T? defaultValue}) → T? - Coerce value to expected type.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
parseList<
T> (Map< String, dynamic> json, String field, {List<T> ? defaultValue, T itemParser(dynamic)?}) → List<T> - Parse list field with coercion.
-
parseOptional<
T> (Map< String, dynamic> json, String field, {T? defaultValue}) → T? - Parse optional field with coercion.
-
parseRequired<
T> (Map< String, dynamic> json, String field, List<BundleLoadException> errors, {T? defaultValue}) → T - Parse required field with coercion.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited