Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

json to dart

class Autogenerated {
  int? id;
  int? age;
  String? name;

  Autogenerated({this.id, this.age, this.name});

  Autogenerated.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    age = json['age'];
    name = json['name'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['age'] = this.age;
    data['name'] = this.name;
    return data;
  }
}
Source by javiercbk.github.io #
 
PREVIOUS NEXT
Tagged: #json #dart
ADD COMMENT
Topic
Name
5+9 =