JSON class

Small helper to turn data into JSON and JSON back into data.

It works with a String or with UTF-8 bytes.

String text = JSON.stringify({'name': 'dox'});
List<int> bytes = JSON.bytes({'name': 'dox'});
Map<String, dynamic> data = JSON.parse(text);

Constructors

JSON()

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

bytes(Object? value) → List<int>
Turns value into UTF-8 bytes, in one pass.
parse(Object input) → dynamic
Reads JSON from a String or from UTF-8 bytes.
stringify(Object? value) → String
Turns value into a JSON String.