class ApiResponseModel<T> {
  final String status;
  final String message;
  final T? data;
  final Map<String, dynamic>? error;

  ApiResponseModel({
    required this.status,
    required this.message,
    this.data,
    this.error,
  });

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