{
"message": "Success",
"statusCode": 200,
"success": true,
"data": { // <-- products list_response
"total": 194,
"data": [ // <-- products list
{
"id": 1,
"title": "Essence Mascara Lash Princess",
"category": "beauty",
"price": 9.99,
"rating": 4.94,
"stock": 5
}
]
}
}
@RestApi()
abstract class ProductRestClient {
factory ProductRestClient(Dio dio) = _ProductRestClient;
@GET("/products")
Future<BaseResponse<ListResponse<Product>>> findAll({
@Query("page") required int page,
@Query("per_page") int perPage = 25,
});
}