23 lines
463 B
Dart
23 lines
463 B
Dart
class LoginModel {
|
|
String email;
|
|
String password;
|
|
|
|
LoginModel({required this.email, required this.password});
|
|
|
|
// For converting to JSON
|
|
Map<String, dynamic> toJson() {
|
|
return {
|
|
'email': email,
|
|
'password': password,
|
|
};
|
|
}
|
|
|
|
// For creating an instance from JSON
|
|
factory LoginModel.fromJson(Map<String, dynamic> json) {
|
|
return LoginModel(
|
|
email: json['email'] ?? '',
|
|
password: json['password'] ?? '',
|
|
);
|
|
}
|
|
}
|