json_serializer 0.0.1 copy "json_serializer: ^0.0.1" to clipboard
json_serializer: ^0.0.1 copied to clipboard

Automatically convert JSON to dart objects in runtime without code generation.

json_serializer #

🚧 Experimental State 🚧

Automatically convert JSON to dart objects in runtime without code generation.

Setup #

To configure your project for the latest released version of json_serializer, see the [example].

Example #

Given a library example.dart with an Person class:

class Person {
  final String firstName;
  final String lastName;
  final DateTime? dateOfBirth;

  Person({
    required this.firstName,
    required this.lastName,
    this.dateOfBirth,
  });
}

Let json_serializer know about your class

JsonSerializer.options = JsonSerializerOptions(userTypes: [
  UserType<Person>(Person.new),
]);

And serialize a json to this class

JsonSerializer.deserialize<Person>(json);
10
likes
0
points
1.82k
downloads

Publisher

verified publisheredsonbonfim.com

Weekly Downloads

Automatically convert JSON to dart objects in runtime without code generation.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

fake_reflection

More

Packages that depend on json_serializer