AuthResponse.fromJson constructor

AuthResponse.fromJson(
  1. Map<String, dynamic> json
)

Crea una instancia a partir del JSON devuelto por el backend.

Implementation

factory AuthResponse.fromJson(Map<String, dynamic> json) {
  return AuthResponse(
    token: json['token'] as String,
    userId: json['userId'] as String,
    email: json['email'] as String,
    name: json['name'] as String,
    role: json['role'] as String,
    serviceId: json['serviceId'] as String?,
  );
}