iv_and/product.dart
joe a8242c2a7e
Some checks are pending
Flutter CI / build (push) Waiting to run
feat: Invoiceアプリの基本機能を追加
Co-authored-by: aider (ollama_chat/7b) <aider@aider.chat>
2026-01-16 09:35:27 +09:00

31 lines
612 B
Dart

class Product {
final int? id;
final String name;
final double unitPrice;
final double discount;
Product({
this.id,
required this.name,
required this.unitPrice,
required this.discount,
});
Map<String, dynamic> toMap() {
return {
'id': id,
'name': name,
'unit_price': unitPrice,
'discount': discount,
};
}
factory Product.fromMap(Map<String, dynamic> map) {
return Product(
id: map['id'] as int?,
name: map['name'] as String,
unitPrice: map['unit_price'] as double,
discount: map['discount'] as double,
);
}
}