Files
2026-09-28 11:39:19 +08:00

46 lines
1.6 KiB
Dart
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'widgets/manual_entry_tab.dart';
/// 记账页内部 Tab:0=手动记账 1=OCR识别
///
/// ⚠️ **OCR 已从前端隐藏**(2026-09-28,用户不再需要)。这个 provider 先留着,
/// 因为 `widgets/ocr_result_card.dart` 还在引用它 —— OCR 相关的那几个文件
/// (`ocr_tab.dart` / `ocr_result_card.dart` / `ocr_provider.dart` /
/// `ocr_api.dart` / `ocr_result.dart`)都保留着,没有删。
///
/// 要恢复 OCR:把下面 body 换回「Tab 栏 + `tabIndex == 0 ? ManualEntryTab : OcrTab`」
/// 就行,后端 `/api/ocr/**` 也一直没停。
class AddTabNotifier extends Notifier<int> {
@override
int build() => 0;
void set(int index) => state = index;
}
final addTabProvider = NotifierProvider<AddTabNotifier, int>(AddTabNotifier.new);
/// 记账页(原本是「手动记账 / OCR识别」双 Tab,现在只剩手动记账)
class AddPage extends ConsumerWidget {
const AddPage({super.key});
@override
Widget build(BuildContext context, WidgetRef ref) {
return Scaffold(
appBar: AppBar(title: const Text('添加账单')),
body: Container(
decoration: const BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [Color(0xFFFFE5CC), Color(0xFFFFD4A8), Color(0xFFFFC08A)],
),
),
// ManualEntryTab 自带 ListView,直接铺满就行
child: const ManualEntryTab(),
),
);
}
}