If the price is coming as an integer but you wish to make it double why not parse it?
There could several ways but i suggest
{
'mid': int mid,
'icode': String icode,
'name': String name,
'description': String description,
'price': num? price, // could be anything (int, double or null)
'gid': int gid,
'gname': String gname,
'pic': String pic,
'quantity': int quantity,
} =>
Product(
mid: mid,
icode: icode,
name: name,
description: description,
price: price?.toDouble() ?? 0.0, // if null add default value else make it double
gid: gid,
gname: gname,
pic: pic,
quantity: quantity,
),
This way if price is null you get a default value while if it is int or double either way it will be converted to double.