Closed shehriyarmalik closed 3 years ago
@shehriyarmalik try converting element.data()["price"] into a double in your file product_provider.dart, line:131
Future
If the above answer doesn't help you, then also this error is not related to the provider.
[VERBOSE-2:ui_dart_state.cc(166)] Unhandled Exception: type 'int' is not a subtype of type 'double'
The second line of your issue itself is very clear, it says you are trying to pass or return a int
value to a function or a variable which takes or is of type double
. It is not related to Provider.
Closing as this is unrelated to provider and instead a bug in your code (apparently the getHomeAchiveData method).
If you still have a problem, consider asking your question on StackOverflow
So I am trying to retrieve data from Firebase however I am encountering error. I am getting this error:
[VERBOSE-2:ui_dart_state.cc(166)] Unhandled Exception: type 'int' is not a subtype of type 'double'
0 ProductProvider.getHomeAchiveData. (package:final_ecommerce/provider/product_provider.dart:139:34)
1 List.forEach (dart:core-patch/growable_array.dart:302:8)
2 ProductProvider.getHomeAchiveData (package:final_ecommerce/provider/product_provider.dart:134:26)