A non-null String must be provided to a Text widget

前端 未结 9 1677
醉酒成梦
醉酒成梦 2021-02-13 20:15

I\'m trying to add the option for the quantity to be adjusted but I get an error saying \"A non-null String must be provided to a Text widget\" How do I provide this, to this co

9条回答
  •  花落未央
    2021-02-13 21:00

    The problem is visible. You're passing null to Text widget. new Text(cart_prod_qty) This can be due to delay of response from api (if you're using it). Or there is no value in the variable "cart_prod_qty". You can handle it like this: new Text(cart_prod_qty != null ? cart_prod_qty.toString : '')

提交回复
热议问题