ApiResponse<T>.fromJson constructor

ApiResponse<T>.fromJson(
  1. Map<String, dynamic> json,
  2. T fromJsonT(
    1. Object? json
    )
)

Implementation

factory ApiResponse.fromJson(
  final Map<String, dynamic> json,
  T Function(Object? json) fromJsonT,
) {
  return ApiResponse<T>(
    count: json['count'],
    data: (json['data'] as List<dynamic>).map(fromJsonT).toList(),
  );
}