first commit

This commit is contained in:
2026-09-21 17:37:53 +08:00
commit 67d4dd5b7c
141 changed files with 8558 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
/// OCR 识别出的单条账单
class OcrResult {
final double amount; // 负数=支出,正数=收入(与 uniApp 语义一致)
final String? merchant;
final String? date;
final double? confidence;
const OcrResult({
required this.amount,
this.merchant,
this.date,
this.confidence,
});
bool get isExpense => amount < 0;
double get absAmount => amount.abs();
factory OcrResult.fromJson(Map<String, dynamic> json) => OcrResult(
amount: (json['amount'] as num?)?.toDouble() ?? 0,
merchant: json['merchant']?.toString(),
date: json['date']?.toString(),
confidence: (json['confidence'] as num?)?.toDouble(),
);
}