GetProductsSearchResponse.fromJson constructor
GetProductsSearchResponse.fromJson(
- Object? json
Implementation
factory GetProductsSearchResponse.fromJson(Object? json) {
final map = (json as Map).cast<String, Object?>();
return GetProductsSearchResponse(
data: (map['data'] as List<Object?>)
.map((el) => Product.fromJson(el))
.toList(),
hasMore: (map['has_more'] as bool),
nextPage: map['next_page'] == null ? null : (map['next_page'] as String),
totalCount: map['total_count'] == null
? null
: (map['total_count'] as num).toInt(),
url: (map['url'] as String),
);
}