36 lines
955 B
Dart
36 lines
955 B
Dart
import '../utilsParse.dart';
|
|
import 'user.dart';
|
|
|
|
class AuthResponse {
|
|
final AuthBody? body;
|
|
final int? status;
|
|
final bool? operation;
|
|
|
|
|
|
AuthResponse( {this.body, this.status, this.operation});
|
|
|
|
factory AuthResponse.fromJson(Map<String, dynamic> json) {
|
|
return AuthResponse(
|
|
operation: json['operation'],
|
|
status: json['status'],
|
|
body: AuthBody.fromJson(json['body'])
|
|
);
|
|
}
|
|
}
|
|
|
|
class AuthBody {
|
|
final List<String>? email;
|
|
final List<String>? password;
|
|
final String? message;
|
|
final User? user;
|
|
AuthBody({this.message, this.user, this.email, this.password});
|
|
factory AuthBody.fromJson(Map<String, dynamic> json) {
|
|
return AuthBody(
|
|
email: json['email']!=null ? parseListString(json['email']): null,
|
|
message: json['message'],
|
|
password: json['password']!=null ? parseListString(json['password']): null,
|
|
user: json['user']!=null ? User.fromJson(json['user']) : null
|
|
);
|
|
}
|
|
}
|