I already have a null check before using the value but it still give me error
>Solution :
You can put an ! behind it to indicate you are sure it can’t be null, so like
for (final value in widget.details.data.productPriceObjs!) {
If you don’t like using ! you can alternatively write
var objects = widget.details.data.productPriceObjs;
if (objects != null) {
for (final value in objects) {
}
}
Somehow the compiler is fine with it when there isn’t "nesting" in the check