123456789101112131415161718192021222324 |
- import 'base_model.dart';
- class UserModel extends BaseModel {
- String name = "";
- int id = 0;
- String email = "";
- int age = 0;
- UserModel.fromJson(Map<String, dynamic> json) {
- name = json['name'];
- id = json['id'];
- email = json['email'];
- age = json['age'];
- }
- Map<String, dynamic> toJson() {
- final Map<String, dynamic> data = <String, dynamic>{};
- data['name'] = name;
- data['id'] = id;
- data['email'] = email;
- data['age'] = age;
- return data;
- }
- }
|