safe_json 1.0.7 copy "safe_json: ^1.0.7" to clipboard
safe_json: ^1.0.7 copied to clipboard

Primary purpose of this library is to find out backend error(incomplete data) at the first time.

example/main.dart

import 'models/user.dart';

void main() {
  Map<String, dynamic> json = {
    'age': '30.0',
    'articles': [
      'article1',
      'article2',
    ],
    'vehicles': [
      {'make': 'Toyota', 'model': 'Camry'},
      {'make': 'Honda', 'model': 'Accord'},
    ],
  };

  User user = User.fromJson(json);

  print(user.name); // John
  print(user.age); // 30
  print(user.school); // MIT
  print(user.articles); // [article1, article2]
  print(user.vehicles); // [Toyota Camry, Honda Accord]
}
1
likes
0
points
43
downloads

Publisher

unverified uploader

Weekly Downloads

Primary purpose of this library is to find out backend error(incomplete data) at the first time.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on safe_json