Created
December 2, 2019 08:12
-
-
Save inan-mahmud/d13545a701d388b205b2451ae7c50509 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:hub_food_park/pojos/user/result.dart'; | |
class UserResponse { | |
bool status; | |
Result result; | |
UserResponse({this.status, this.result}); | |
UserResponse.fromJson(Map<String, dynamic> json) { | |
status = json['status']; | |
result = | |
json['result'] != null ? new Result.fromJson(json['result']) : null; | |
} | |
bool getStatus() { | |
return this.status; | |
} | |
Map<String, dynamic> toJson() { | |
final Map<String, dynamic> data = new Map<String, dynamic>(); | |
data['status'] = this.status; | |
if (this.result != null) { | |
data['result'] = this.result.toJson(); | |
} | |
return data; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:hub_food_park/pojos/user/users.dart'; | |
class Result { | |
String msg; | |
bool success; | |
User users; | |
Result({this.msg, this.success, this.users}); | |
Result.fromJson(Map<String, dynamic> json) { | |
msg = json['msg']; | |
success = json['success']; | |
users = json['users'] != null ? new User.fromJson(json['users']) : null; | |
} | |
Map<String, dynamic> toJson() { | |
final Map<String, dynamic> data = new Map<String, dynamic>(); | |
data['msg'] = this.msg; | |
data['success'] = this.success; | |
if (this.users != null) { | |
data['users'] = this.users.toJson(); | |
} | |
return data; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User { | |
String id; | |
String firstName; | |
String lastName; | |
String email; | |
String userType; | |
String newPassword; | |
User.fromUser(this.firstName, this.lastName, this.email, this.phone, | |
this.password, this.userType); | |
String company; | |
String address; | |
String city; | |
String state; | |
String zipcode; | |
String phone; | |
String password; | |
User( | |
{this.id, | |
this.firstName, | |
this.lastName, | |
this.email, | |
this.userType, | |
this.company, | |
this.address, | |
this.city, | |
this.state, | |
this.zipcode, | |
this.phone, | |
this.password}); | |
User.fromJson(Map<String, dynamic> json) { | |
id = json['id']; | |
firstName = json['first_name']; | |
lastName = json['last_name']; | |
email = json['email']; | |
userType = json['user_type']; | |
company = json['company']; | |
address = json['address']; | |
city = json['city']; | |
state = json['state']; | |
zipcode = json['zipcode']; | |
phone = json['phone']; | |
password = json['password']; | |
} | |
Map<String, dynamic> toJson() { | |
final Map<String, dynamic> data = new Map<String, dynamic>(); | |
data['id'] = this.id; | |
data['first_name'] = this.firstName; | |
data['last_name'] = this.lastName; | |
data['email'] = this.email; | |
data['user_type'] = this.userType; | |
data['company'] = this.company; | |
data['address'] = this.address; | |
data['city'] = this.city; | |
data['state'] = this.state; | |
data['zipcode'] = this.zipcode; | |
data['phone'] = this.phone; | |
data['password'] = this.password; | |
return data; | |
} | |
Map<String, dynamic> toUser() { | |
final Map<String, dynamic> data = new Map<String, dynamic>(); | |
data['first_name'] = this.firstName; | |
data['last_name'] = this.lastName; | |
data['email'] = this.email; | |
data['phone'] = this.phone; | |
data['password'] = this.password; | |
data['user_type'] = this.userType; | |
return data; | |
} | |
Map<String, dynamic> toLoggedInUser() { | |
final Map<String, dynamic> data = new Map<String, dynamic>(); | |
data['email'] = this.email; | |
data['password'] = this.password; | |
return data; | |
} | |
Map<String, dynamic> toUpdateProfileUser() { | |
final Map<String, dynamic> data = new Map<String, dynamic>(); | |
data['id'] = this.id; | |
data['first_name'] = this.firstName; | |
data['last_name'] = this.lastName; | |
data['email'] = this.email; | |
data['phone'] = this.phone; | |
return data; | |
} | |
User.name(this.email, this.password); | |
Map<String, dynamic> toUpdatePassword() { | |
final Map<String, dynamic> data = new Map<String, dynamic>(); | |
data['id'] = this.id; | |
data['email'] = this.email; | |
data['currentPassword'] = this.password; | |
data['newPassword'] = this.newPassword; | |
return data; | |
} | |
User.pass(this.id, this.email, this.password, this.newPassword); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment