Smart_Vision_Assist_App/lib/models/register_response.dart

22 lines
509 B
Dart

class RegisterResponse {
final String status;
final String message;
final String? token;
const RegisterResponse({
required this.status,
required this.message,
this.token,
});
factory RegisterResponse.fromJson(Map<String, dynamic> json) {
return RegisterResponse(
status: json["status"]?.toString() ?? "error",
message: json["message"]?.toString() ?? "",
token: json["token"]?.toString(),
);
}
bool get isSuccess => status.toLowerCase() == "success";
}