class ProductNameOption { final int id; final String? code; final String name; final String? remark; const ProductNameOption({ required this.id, this.code, required this.name, this.remark, }); factory ProductNameOption.fromJson(Map json) => ProductNameOption( id: (json['id'] as num).toInt(), code: json['code'] as String?, name: json['name'] as String, remark: json['remark'] as String?, ); } class ProductSeriesOption { final int id; final String? code; final String name; final String? remark; const ProductSeriesOption({ required this.id, this.code, required this.name, this.remark, }); factory ProductSeriesOption.fromJson(Map json) => ProductSeriesOption( id: (json['id'] as num).toInt(), code: json['code'] as String?, name: json['name'] as String, remark: json['remark'] as String?, ); } class ProductSpecOption { final int id; final String? code; final String name; final int quantity; final String? remark; const ProductSpecOption({ required this.id, this.code, required this.name, this.quantity = 0, this.remark, }); factory ProductSpecOption.fromJson(Map json) => ProductSpecOption( id: (json['id'] as num).toInt(), code: json['code'] as String?, name: json['name'] as String, quantity: (json['quantity'] as num?)?.toInt() ?? 0, remark: json['remark'] as String?, ); }