added changes to login model and start of receipt

This commit is contained in:
Finn 2019-05-10 12:43:45 +01:00
parent 3af4997c01
commit 075a57278f
No known key found for this signature in database
GPG key ID: 7455B4B17685B598
10 changed files with 122 additions and 79 deletions

View file

@ -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,
};
}