AuthResponseModel.fromJson constructor

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

Creates a new instance of the AuthResponseModel class from a JSON map.

The json parameter is a JSON map representing the authentication response. The keys 'data', 'token', and 'meta' are used to extract the corresponding values.

Implementation

factory AuthResponseModel.fromJson(Map<String, dynamic> json) =>
    AuthResponseModel(
      user: UserModel.fromJson(json["data"]),
      token: json["token"],
      meta: json["meta"] == null ? null : MetaData.fromJson(json["meta"]),
    );