import 'package:wow_english/generated/json/base/json_convert_content.dart'; import 'package:wow_english/models/product_entity.dart'; ProductEntity $ProductEntityFromJson(Map json) { final ProductEntity productEntity = ProductEntity(); final String? name = jsonConvert.convert(json['name']); if (name != null) { productEntity.name = name; } final double? price = jsonConvert.convert(json['price']); if (price != null) { productEntity.price = price; } return productEntity; } Map $ProductEntityToJson(ProductEntity entity) { final Map data = {}; data['name'] = entity.name; data['price'] = entity.price; return data; } extension ProductEntityExtension on ProductEntity { ProductEntity copyWith({ String? name, double? price, }) { return ProductEntity() ..name = name ?? this.name ..price = price ?? this.price; } }