I couldn't transform my fetched the data,
But no errors showing, I have added a print statement to find error where it occurs
Future<void> fetchAndSetProduct() async {
final url =
Uri.https('shopda-83b00-default-rtdb.firebaseio.com', '/products');
try {
print("karan oneonofne ");
final response = await http.get(url);
final extractData = json.decode(response.body) as Map<String, dynamic>;
final List<Product> loadedProduct = [];
extractData.forEach((prodId, prodData) {
loadedProduct.add(Product(
id: prodId,
title: prodData['title'],
description: prodData['description'],
price: prodData['price'],
isFavourite: prodData['isFavourite'],
imageUrl: prodData['imageUrl']));
});
print(loadedProduct[1]);
_items = loadedProduct;
notifyListeners();
} catch (error) {
throw (error);
} finally {
print('object');
}
}
Still, I couldn't get data.I think I couldn't change HTML to Jason


Uri.https, I recommend usingUri.parsewith an URL that you've tested with a browser.