Product.fromMap constructor
Implementation
factory Product.fromMap(Map<String, dynamic> map) {
return Product(
id: map['id'] ?? '',
name: map['name'] ?? '',
desc: map['desc'] ?? '',
price: (map['price'] as num?)?.toDouble() ?? 0.0,
localPrice: map['localPrice'] ?? '',
type: map['type'] ?? '',
rawJson: map['rawJson'] ?? '',
periodUnit: map['periodUnit'] ?? '',
periodValue: map['periodValue'] ?? 0,
period: map['period'] ?? '',
introOffer: map['introOffer'] ?? '',
introPeriod: map['introPeriod'] ?? '',
hasTrial: map['hasTrial'] ?? false,
);
}