Utility class for JSON parsing and validation. For type conversions (lists, strings, numbers, dates), see JsonTypeUtils.
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
-
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
Static Methods
-
cleanJsonResponse(
String? value) → String? -
Returns a cleaned version of the JSON response
valueby stripping outer double-quotes and unescaping any inner escaped quotes (\"), ornullif the result is empty. -
isJson(
String? value, {bool shouldTestDecode = false, bool shouldAllowEmpty = false}) → bool -
Returns
trueifvalueappears to be valid JSON. -
jsonDecodeSafe(
String? jsonString) → dynamic - Safely decodes a JSON string, returning null on error.
-
jsonDecodeToMap(
String? jsonString) → Map< String, dynamic> ? -
Returns a decoded
Mapfrom the givenjsonString, ornullif decoding fails. -
tryJsonDecode(
String? value, {bool shouldCleanInput = false}) → Map< String, dynamic> ? -
Returns a decoded
Mapfrom the JSON stringvalue, optionally cleaning the input first whenshouldCleanInputistrue, ornullif decoding fails. -
tryJsonDecodeList(
String? value) → List< String> ? -
Returns a list of strings decoded from the JSON string
value, ornullif decoding fails. -
tryJsonDecodeListMap(
String? value) → List< Map< ?String, dynamic> > -
Returns a list of maps decoded from the JSON string
value, ornullif decoding fails.