June 2017
Intermediate to advanced
873 pages
18h 9m
English
JavaScript Object Notation (JSON) is probably the most widely used data format in web applications, so it is a common requirement for a class to be able to serialize its objects to JSON strings, or reconstruct objects from JSON strings.
JSON is lightweight (not as verbose as XML) and text-based, so it is easily readable by humans. It starts from the notion that the state (or content) of an object is in fact like a map; the keys are the field names, and their values are the concrete data stored in the fields. For example, (see project json/job.dart), say we have a class Job defined, as shown in the following code:
class Job { String type; int salary; String company; Job(this.type, this.salary, ...Read now
Unlock full access