40 lines
744 B
Dart
40 lines
744 B
Dart
/// One visually reconstructed receipt row from clustered OCR elements.
|
|
library;
|
|
|
|
import 'ocr_element.dart';
|
|
import 'receipt_bounds.dart';
|
|
|
|
enum ReceiptRowKind {
|
|
skip,
|
|
quantityModifier,
|
|
nameOnly,
|
|
item,
|
|
discount,
|
|
grandTotal,
|
|
totalDiscount,
|
|
}
|
|
|
|
class ReceiptRow {
|
|
const ReceiptRow({
|
|
required this.kind,
|
|
required this.text,
|
|
required this.nameText,
|
|
this.price,
|
|
this.quantity,
|
|
this.unitPrice,
|
|
this.lineTotal,
|
|
this.elements = const [],
|
|
this.bounds,
|
|
});
|
|
|
|
final ReceiptRowKind kind;
|
|
final String text;
|
|
final String nameText;
|
|
final double? price;
|
|
final int? quantity;
|
|
final double? unitPrice;
|
|
final double? lineTotal;
|
|
final List<OcrElement> elements;
|
|
final ReceiptBounds? bounds;
|
|
}
|