JsonConverter class abstract

Defines interface for safely converting dynamic JSON data to typed Dart objects. Each method performs validation and throws FormatException when input is invalid.

Implementers

Constructors

JsonConverter()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

extractDateTime(dynamic value, String errMsg) DateTime
Converts a String to DateTime, validating input format.
extractDateTimeFromEpochMs(dynamic value, String errMsg) DateTime
Creates a DateTime from epoch milliseconds.
extractDoubleValue(dynamic value, String errMsg) double
Extracts a double from dynamic value, validating its type.
extractIntValue(dynamic value, String errMsg) int
Extracts an int from dynamic value, validating its type.
extractJsonObject(Map data, String errMsg) Map<String, dynamic>
Converts a Map with dynamic keys to a Map with String keys.
extractJsonObjectWithListOfJsonObjects(dynamic value, String errMsg) Map<String, List<Map<String, dynamic>>>
Extracts a nested structure: a Map with String keys and values as Lists of JSON objects.
extractList(dynamic value, String errMsg) List
Extracts a List from dynamic value, validating its type.
extractListOfJsonObjects(dynamic value, String errMsg) List<Map<String, dynamic>>
Extracts a List of JSON objects (Map<String, dynamic>) from dynamic value.
extractMap(dynamic value, String errMsg) Map
Extracts a Map from dynamic value, validating its type.
extractStringValue(dynamic value, String errMsg) String
Extracts a String from dynamic value, validating its type.
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