class Supplier { Supplier({ this.id, this.suppliername, }); Supplier.fromJson(dynamic json) { id = json['id']; suppliername = json['suppliername']; } num? id; // Now nullable String? suppliername; // Now nullable Supplier copyWith({ num? id, // Parameter is now nullable String? suppliername, // Parameter is now nullable }) => Supplier( id: id ?? this.id, suppliername: suppliername ?? this.suppliername, ); Map toJson() { final map = {}; map['id'] = id; map['suppliername'] = suppliername; return map; } }