class UserProfileModel { final String name; final String accessToken; final int age; UserProfileModel({this.name = '', this.accessToken = '', this.age = 0}); UserProfileModel.fromJson(Map json) : name = json['name'], accessToken = json['accessToken'], age = json['age']; Map toJson() { final Map data = new Map(); data['name'] = this.name; data['accessToken'] = this.accessToken; data['age'] = this.age; return data; } }