ParseException class
Exception thrown when an illegal operation occurs during data parsing.
Typically thrown from a model's fromJson factory when deserialization
fails. For error-type counterparts, see ParseError.
Example:
factory MyModel.fromJson(Map<String, dynamic> json) {
final name = json['name'];
if (name is! String) throw ParseException('Expected string for "name"');
return MyModel(name: name);
}
- Implemented types
Constructors
- ParseException(String exception)
Properties
Methods
-
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.
inherited