Untitled
raw download clone
DART
views 8
,
size 775 b
class ProductWisata {
  int idProduct, priceProduct, ticketProduct;
  String titleProduct, contentProduct, picProduct;
  bool value;
  int qty;

  ProductWisata({
    this.idProduct,
    this.ticketProduct,
    this.titleProduct,
    this.contentProduct,
    this.picProduct,
    this.priceProduct,
    this.value = false,
    this.qty = 0,
  });

  factory ProductWisata.fromJson(Map<String, dynamic> parsedJson) {
    return ProductWisata(
      idProduct: parsedJson['id'] ?? {},
      titleProduct: parsedJson['title'] ?? {},
      contentProduct: parsedJson['content'] ?? {},
      picProduct: parsedJson['pic'][0]['nama'] ?? {},
      priceProduct: parsedJson['price'] ?? {},
      ticketProduct: parsedJson['is_ticket'] ?? {},
    );
  }
}
close fullscreen
Login or Register to edit or fork this paste. It's free.