APIResponse<T>.fromJson constructor

APIResponse<T>.fromJson(
  1. Map<String, dynamic> data
)

Implementation

factory APIResponse.fromJson(Map<String, dynamic> data){
  return APIResponse(
      error: data['status'] != null ? !data['status'] : data['error'] ?? false,
      message: data['message'],
      data: data['data']
  );
}