This commit is contained in:
2026-03-21 22:48:30 +03:00
parent a0f800cfe4
commit a9be4f6162
21 changed files with 966 additions and 757 deletions
+9 -7
View File
@@ -1,7 +1,6 @@
import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:go_router/go_router.dart';
import 'package:intl/intl.dart';
import '../../core/constants.dart';
import '../../core/l10n/locale_provider.dart';
@@ -199,6 +198,7 @@ class _PieChartCard extends ConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final s = ref.watch(stringsProvider);
final fmt = ref.watch(amountFormatProvider);
final entries = data.entries.toList();
@@ -255,7 +255,7 @@ class _PieChartCard extends ConsumerWidget {
mainAxisSize: MainAxisSize.min,
children: [
Text(
'Total',
s.total,
style: Theme.of(context).textTheme.bodySmall?.copyWith(
color: Theme.of(context).colorScheme.onSurface.withOpacity(0.6),
),
@@ -285,6 +285,7 @@ class _BarChartCard extends ConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final s = ref.watch(stringsProvider);
final fmt = ref.watch(amountFormatProvider);
final maxY = monthlyData.map((e) => e.amount).reduce((a, b) => a > b ? a : b);
final adjustedMaxY = maxY * 1.2;
@@ -299,7 +300,7 @@ class _BarChartCard extends ConsumerWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Last 6 Months',
s.lastSixMonths,
style: Theme.of(context).textTheme.titleSmall?.copyWith(
color: Theme.of(context).colorScheme.onSurface.withOpacity(0.6),
fontWeight: FontWeight.w600,
@@ -497,11 +498,12 @@ class _CategoryRow extends ConsumerWidget {
}
}
class _EmptyState extends StatelessWidget {
class _EmptyState extends ConsumerWidget {
const _EmptyState();
@override
Widget build(BuildContext context) {
Widget build(BuildContext context, WidgetRef ref) {
final s = ref.watch(stringsProvider);
return Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
@@ -520,7 +522,7 @@ class _EmptyState extends StatelessWidget {
),
const SizedBox(height: 16),
Text(
'No expense data',
s.noExpenseData,
style: Theme.of(context).textTheme.titleMedium?.copyWith(
color: Theme.of(context).colorScheme.onSurface,
fontWeight: FontWeight.w600,
@@ -528,7 +530,7 @@ class _EmptyState extends StatelessWidget {
),
const SizedBox(height: 6),
Text(
'Add some expenses to see the breakdown',
s.addExpensesToSeeBreakdown,
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
color: Theme.of(context).colorScheme.onSurface.withOpacity(0.6),
),