added changes to login model and start of receipt
This commit is contained in:
parent
3af4997c01
commit
075a57278f
10 changed files with 122 additions and 79 deletions
|
@ -1,21 +1,15 @@
|
|||
class LoginModel {
|
||||
final String userName;
|
||||
final String token;
|
||||
final String email;
|
||||
final int userId;
|
||||
|
||||
LoginModel(this.userName, this.token, this.email, this.userId);
|
||||
LoginModel(this.userName, this.token);
|
||||
|
||||
LoginModel.fromJson(Map<String, dynamic> json)
|
||||
: userName = json['name'],
|
||||
token = json['token'],
|
||||
email = json['email'],
|
||||
userId = json['pk'];
|
||||
: userName = json['display_name'],
|
||||
token = json['session_key'];
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'name': userName,
|
||||
'token': token,
|
||||
'email': email,
|
||||
'pk': userId,
|
||||
};
|
||||
}
|
||||
|
|
Reference in a new issue