Base user workflow (create/update)
This commit is contained in:
parent
eb5d3e2b70
commit
45be2c80ff
8 changed files with 528 additions and 17 deletions
27
lib/api/model/user_model.dart
Normal file
27
lib/api/model/user_model.dart
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
class UserModel {
|
||||
final int id;
|
||||
final String username;
|
||||
final String? password;
|
||||
final String? accessToken;
|
||||
|
||||
UserModel({
|
||||
required this.id,
|
||||
required this.username,
|
||||
this.password,
|
||||
this.accessToken,
|
||||
});
|
||||
|
||||
factory UserModel.fromJson(Map<String, dynamic> json) => UserModel(
|
||||
id: json["id"],
|
||||
username: json["username"],
|
||||
password: json["password"],
|
||||
accessToken: json["access_token"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"username": username,
|
||||
"password": password,
|
||||
"access_token": accessToken,
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue