json_safe library
Functions
-
decodeJsonStringToMap(
String input) → JsonMap -
Parses
inputinto a JsonMap. -
deserializeJson<
T> (String input, T fromJson(JsonMap json)) → T -
Deserializes
inputinto a model usingfromJson. -
deserializeJsonMap<
T> (JsonMap map, {required T fromJson(JsonMap json)}) → T -
Deserializes a decoded JSON map into an instance of
T. -
jsonEncode(
JsonMap map) → String -
Type-safe wrapper over convert.jsonEncode that accepts a
Mapinstead ofObject? -
jsonEncodePretty(
JsonMap map) → String
Typedefs
Exceptions / Errors
- JsonDecodingException
- Occurs while decoding the JSON String. Indicates invalid or malformed JSON.
- JsonDeserializationException
- Occurs while deserializing a decoded JSON object. Indicates a structural or type mismatch between JSON and the expected model.
- JsonObjectExpectedException
- Occurs when a valid JSON value is not a JSON object (JsonMap).
- JsonParseException