How to use double value in Text widget in flutter
Solution 1:
Try below code hope its help to you.
Your var declaration:
double price = 109.95;
Your Widget:
Using String Interpolation:
Text(
'Price: $price',
),
OR Using toString():
Text(
price.toString() ,
),
Result Screen->
Solution 2:
Answer of @Ravindra is correct but you need to fix your model.
First, change price type to double
Second, change
price: json['price']
to
price: (json['price'] as num)?.toDouble()