SimpleListResponse<T>.fromJson constructor

SimpleListResponse<T>.fromJson(
  1. Map<String, dynamic> json,
  2. T objectMapper(
    1. Map<String, dynamic>
    )
)

Implementation

factory SimpleListResponse.fromJson(
  Map<String, dynamic> json,
  T Function(Map<String, dynamic>) objectMapper,
) =>
    SimpleListResponse(
      totalCount: json["totalCount"] as int,
      items: List<T>.from((json["items"] as List<Map<String, dynamic>>)
          .map<T>((model) => objectMapper(model))),
    );