class BookInstance { BookInstance({ required this.balId, required this.bookId, required this.id, required this.ownerId, required this.price, required this.available, this.soldPrice, }); int balId; int bookId; int id; int ownerId; double price; double? soldPrice; bool available; factory BookInstance.fromJSON(Map json) => BookInstance( balId: json["bal_id"], bookId: json["book_id"], id: json["id"], ownerId: json["owner_id"], price: json["price"], available: json["available"], soldPrice: json["sold_price"] ?? 0, ); }