skip to Main Content

type '(dynamic) => ProductModel' is not a subtype of type '(String, dynamic) => MapEntry<dynamic, dynamic>' of 'transform' – Flutter

Tried almost every solution. No luck :( Future<List<ProductModel>> getProducts() async { try { final response = await apiService.sendRequest.get('/product'); if (response.data != null) { print("Data == $response"); return response.data .map((e) => ProductModel.fromJson(e.toMap())) // error is thrown here .toList(); } return <ProductModel>[];…

VIEW QUESTION

how to remove data from List<map> message = []; – Flutter

[ { "booking_no": "HC60398", "sender_name": "Tanvir", "receiver_name": "House", "sender_image": "image link", "receiver_image": "image link", "chat_id": "2", "message": "hlw", "files": [], }, { "booking_no": "HC60398", "sender_name": "Tanvir", "receiver_name": "House", "sender_image": "image link", "receiver_image": "image link", "chat_id": "2", "message": "hi", }, {…

VIEW QUESTION
Back To Top
Search