class Product { int? id; String name; String code; int quantity; double price; String? description; Product({ this.id, required this.name, required this.code, required this.quantity, required this.price, this.description, }); Map toMap() { return { 'id': id, 'name': name, 'code': code, 'quantity': quantity, 'price': price, 'description': description, }; } factory Product.fromMap(Map map) { return Product( id: map['id'], name: map['name'], code: map['code'], quantity: map['quantity'], price: map['price'], description: map['description'], ); } @override String toString() { return 'Product(id: $id, name: $name, code: $code, quantity: $quantity, price: $price, description: $description)'; } }