Product.fromMap constructor

Product.fromMap(
  1. Map<String, dynamic> map
)

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,
  );
}