You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
829 B
42 lines
829 B
import 'package:flutter/cupertino.dart'; |
|
|
|
class UserModel { |
|
int? id; |
|
String? username; |
|
String? fullname; |
|
String? email; |
|
String? password; |
|
int? role_id; |
|
String? token; |
|
|
|
UserModel({ |
|
this.id, |
|
this.username, |
|
this.fullname, |
|
this.email, |
|
this.password, |
|
this.role_id, |
|
this.token, |
|
}); |
|
|
|
UserModel.fromJson(Map<String, dynamic> json) { |
|
id = json['id']; |
|
username = json['username']; |
|
fullname = json['fullname']; |
|
email = json['email']; |
|
password = json['password']; |
|
role_id = int.parse(json['role_id'].toString()); |
|
token = json['token'].toString(); |
|
} |
|
|
|
Map<String, dynamic> toJson() { |
|
return { |
|
'id': id, |
|
'username': username, |
|
'email': email, |
|
'password': password, |
|
'role_id': role_id, |
|
'token': token.toString(), |
|
}; |
|
} |
|
}
|
|
|