style(app): остальные экраны под новый визуальный язык и форматирование
Доходы, ребалансировка, налоги, импорт, цели, здоровье данных, правила, транзакции, категории, cashflow, pending: новые виджеты и токены темы, dart format. Тесты подстроены под новые модели.
This commit is contained in:
@@ -23,7 +23,8 @@ class _GoalsPageState extends ConsumerState<GoalsPage> {
|
||||
bool _showArchived = false;
|
||||
|
||||
void _snack(String message) =>
|
||||
ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text(message)));
|
||||
ScaffoldMessenger.of(context)
|
||||
.showSnackBar(SnackBar(content: Text(message)));
|
||||
|
||||
Future<void> _create() async {
|
||||
final goal = await showDialog<Goal>(
|
||||
@@ -62,8 +63,14 @@ class _GoalsPageState extends ConsumerState<GoalsPage> {
|
||||
title: const Text('Удалить цель?'),
|
||||
content: Text('«${goal.name}» будет удалена безвозвратно.'),
|
||||
actions: [
|
||||
TextButton(onPressed: () => Navigator.of(ctx).pop(false), child: const Text('Отмена')),
|
||||
FilledButton(onPressed: () => Navigator.of(ctx).pop(true), child: const Text('Удалить')),
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(ctx).pop(false),
|
||||
child: const Text('Отмена'),
|
||||
),
|
||||
FilledButton(
|
||||
onPressed: () => Navigator.of(ctx).pop(true),
|
||||
child: const Text('Удалить'),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
@@ -82,10 +89,13 @@ class _GoalsPageState extends ConsumerState<GoalsPage> {
|
||||
final goals = ref.watch(goalsProvider);
|
||||
// Every card's own progress fetch counts toward the one banner too — a fresh list with a
|
||||
// stale progress card is still an offline dashboard, just not a visibly empty one.
|
||||
final goalIds = [for (final g in goals.valueOrNull?.data ?? const <Goal>[]) g.id];
|
||||
final goalIds = [
|
||||
for (final g in goals.valueOrNull?.data ?? const <Goal>[]) g.id,
|
||||
];
|
||||
final stale = oldestFetch([
|
||||
goals.valueOrNull?.fetchedAt,
|
||||
for (final id in goalIds) ref.watch(goalProgressProvider(id)).valueOrNull?.fetchedAt,
|
||||
for (final id in goalIds)
|
||||
ref.watch(goalProgressProvider(id)).valueOrNull?.fetchedAt,
|
||||
]);
|
||||
|
||||
return Scaffold(
|
||||
@@ -94,7 +104,9 @@ class _GoalsPageState extends ConsumerState<GoalsPage> {
|
||||
actions: [
|
||||
IconButton(
|
||||
tooltip: _showArchived ? 'Скрыть архив' : 'Показать архив',
|
||||
icon: Icon(_showArchived ? Icons.inventory_2 : Icons.inventory_2_outlined),
|
||||
icon: Icon(
|
||||
_showArchived ? Icons.inventory_2 : Icons.inventory_2_outlined,
|
||||
),
|
||||
onPressed: () => setState(() => _showArchived = !_showArchived),
|
||||
),
|
||||
IconButton(
|
||||
@@ -116,7 +128,9 @@ class _GoalsPageState extends ConsumerState<GoalsPage> {
|
||||
onRetry: () => ref.invalidate(goalsProvider),
|
||||
data: (cached) {
|
||||
final all = cached.data;
|
||||
final rows = _showArchived ? all : all.where((g) => !g.archived).toList();
|
||||
final rows = _showArchived
|
||||
? all
|
||||
: all.where((g) => !g.archived).toList();
|
||||
if (rows.isEmpty) {
|
||||
return ListView(
|
||||
padding: const EdgeInsets.all(16),
|
||||
@@ -127,7 +141,7 @@ class _GoalsPageState extends ConsumerState<GoalsPage> {
|
||||
icon: Icons.flag_outlined,
|
||||
message: all.isEmpty
|
||||
? 'Целей пока нет.\nЦель — это сумма и (необязательно) дата; '
|
||||
'прогноз считает сервер по доходности или по взносам.'
|
||||
'прогноз считает сервер по доходности или по взносам.'
|
||||
: 'Все цели в архиве — включите показ архива.',
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user