toJson method

Map<String, dynamic> toJson()

Converts this AuthResponse instance to a JSON map.

This is useful for serialization, e.g., when storing in local storage.

Implementation

Map<String, dynamic> toJson() {
   return {
     'token': token,
     'user': user.toJson(),
     'hospital': hospital.toJson(),
   };
 }