cd4274575e
- Implemented receipt file upload in ImportRepository with multipart request handling. - Created ParsedReceiptItem model for parsed receipt data. - Added ReceiptImportTab for user interface to upload and review receipts. - Updated ImportScreen to include the new ReceiptImportTab alongside RecipeImportTab. - Introduced flutter_bootstrap.js and index.html for web app initialization. - Added wimp.wasm and flutter.js for enhanced web performance and capabilities.
56 lines
1.4 KiB
Dart
56 lines
1.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import 'recipe_import_tab.dart';
|
|
import 'receipt_import_tab.dart';
|
|
|
|
/// Main import screen with tabs: Recept | Kvitto.
|
|
///
|
|
/// Fas 6a: Recept-fliken är implementerad.
|
|
/// Fas 6b: Kvitto-fliken läggs till i ett senare steg.
|
|
class ImportScreen extends StatefulWidget {
|
|
const ImportScreen({super.key});
|
|
|
|
@override
|
|
State<ImportScreen> createState() => _ImportScreenState();
|
|
}
|
|
|
|
class _ImportScreenState extends State<ImportScreen>
|
|
with SingleTickerProviderStateMixin {
|
|
late final TabController _tabController;
|
|
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
_tabController = TabController(length: 2, vsync: this);
|
|
}
|
|
|
|
@override
|
|
void dispose() {
|
|
_tabController.dispose();
|
|
super.dispose();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar: AppBar(
|
|
title: const Text('Importera'),
|
|
bottom: TabBar(
|
|
controller: _tabController,
|
|
tabs: const [
|
|
Tab(icon: Icon(Icons.restaurant_menu_outlined), text: 'Recept'),
|
|
Tab(icon: Icon(Icons.receipt_long_outlined), text: 'Kvitto'),
|
|
],
|
|
),
|
|
),
|
|
body: TabBarView(
|
|
controller: _tabController,
|
|
children: const [
|
|
RecipeImportTab(),
|
|
ReceiptImportTab(),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|