Display the list of expenses

This commit is contained in:
2025-07-14 16:49:32 +02:00
parent 547e9b7aad
commit 50812af2fc
7 changed files with 145 additions and 57 deletions

View File

@@ -7,6 +7,7 @@ import 'package:moneymgr_mobile/routes/login/manual_auth_screen.dart';
import 'package:moneymgr_mobile/routes/login/qr_auth_screen.dart';
import 'package:moneymgr_mobile/routes/profile/profile_screen.dart';
import 'package:moneymgr_mobile/routes/scan/scan_screen.dart';
import 'package:moneymgr_mobile/routes/scans_list/scans_list_screen.dart';
import 'package:moneymgr_mobile/routes/settings/settings_screen.dart';
import 'package:moneymgr_mobile/services/router/routes_list.dart';
import 'package:moneymgr_mobile/widgets/load_startup_data.dart';
@@ -41,6 +42,13 @@ GoRouter router(Ref ref) {
selectedIcon: Icons.camera_alt,
label: "Scan",
),
NavigationItem(
path: scansPage,
body: (_) => ScansListScreen(),
icon: Icons.list,
selectedIcon: Icons.list_alt,
label: "List",
),
NavigationItem(
path: profilePage,
body: (_) => ProfileScreen(),

View File

@@ -13,8 +13,11 @@ const manualAuthPage = "/login/manual";
/// Settings path
const settingsPage = "/settings";
/// Scan URL path
/// Scan path
const scanPage = "/scan";
/// Scans page
const scansPage = "/scans";
/// Profile path
const profilePage = "/profile";

View File

@@ -16,7 +16,7 @@ typedef ExpensesList = List<Expense>;
@freezed
abstract class BaseExpenseInfo with _$BaseExpenseInfo {
const factory BaseExpenseInfo({
required String label,
required String? label,
required double cost,
required DateTime time,
}) = _BaseExpenseInfo;
@@ -53,6 +53,12 @@ abstract class Expense with _$Expense {
if (mimeType == "image/png") return "$id.png";
return id.toString();
}
/// Get expense label or null if empty
String? get labelOrNull => label == "" ? null : label;
/// Get expense date
DateTime get dateTime => DateTime.fromMillisecondsSinceEpoch(time * 1000);
}
@riverpod