18 lines
404 B
Dart
18 lines
404 B
Dart
import 'package:json_annotation/json_annotation.dart';
|
|
|
|
part 'userModel.g.dart';
|
|
|
|
@JsonSerializable()
|
|
class UserModel {
|
|
final String email;
|
|
final String name;
|
|
final String role; //USER or ADMIN
|
|
|
|
UserModel(this.email, this.name, this.role);
|
|
|
|
factory UserModel.fromJson(Map<String, dynamic> json) =>
|
|
_$UserModelFromJson(json);
|
|
|
|
Map<String, dynamic> toJson() => _$UserModelToJson(this);
|
|
}
|