class ApiResponseModel { final String status; final String message; final T? data; final Map? error; ApiResponseModel({ required this.status, required this.message, this.data, this.error, }); factory ApiResponseModel.fromJson( Map json, T Function(Object? json) fromJsonT, ) { return ApiResponseModel( status: json['status'], message: json['message'], data: json['data'] != null ? fromJsonT(json['data']) : null, error: json['error'], ); } }