style(app): остальные экраны под новый визуальный язык и форматирование
Доходы, ребалансировка, налоги, импорт, цели, здоровье данных, правила, транзакции, категории, cashflow, pending: новые виджеты и токены темы, dart format. Тесты подстроены под новые модели.
This commit is contained in:
@@ -23,7 +23,10 @@ class ReconciliationCard extends StatelessWidget {
|
||||
if (reconciliation.isEmpty) {
|
||||
return Card(
|
||||
child: ListTile(
|
||||
leading: Icon(Icons.remove_circle_outline, color: theme.colorScheme.outline),
|
||||
leading: Icon(
|
||||
Icons.remove_circle_outline,
|
||||
color: theme.colorScheme.outline,
|
||||
),
|
||||
title: Text(title),
|
||||
subtitle: const Text('В отчёте нет остатков для сверки'),
|
||||
),
|
||||
@@ -67,7 +70,12 @@ class ReconciliationCard extends StatelessWidget {
|
||||
Text('Позиции', style: theme.textTheme.titleSmall),
|
||||
const SizedBox(height: 4),
|
||||
_ScrollableTable(
|
||||
columns: const ['Позиция', 'Из отчёта', 'Из леджера', 'Расхождение'],
|
||||
columns: const [
|
||||
'Позиция',
|
||||
'Из отчёта',
|
||||
'Из леджера',
|
||||
'Расхождение',
|
||||
],
|
||||
rows: [
|
||||
for (final p in reconciliation.positions)
|
||||
_Row(
|
||||
@@ -87,7 +95,12 @@ class ReconciliationCard extends StatelessWidget {
|
||||
Text('Денежные остатки', style: theme.textTheme.titleSmall),
|
||||
const SizedBox(height: 4),
|
||||
_ScrollableTable(
|
||||
columns: const ['Валюта', 'Из отчёта', 'Из леджера', 'Расхождение'],
|
||||
columns: const [
|
||||
'Валюта',
|
||||
'Из отчёта',
|
||||
'Из леджера',
|
||||
'Расхождение',
|
||||
],
|
||||
rows: [
|
||||
for (final c in reconciliation.cash)
|
||||
_Row(
|
||||
@@ -145,16 +158,20 @@ class _ScrollableTable extends StatelessWidget {
|
||||
for (final r in rows)
|
||||
DataRow(
|
||||
color: r.highlight
|
||||
? WidgetStatePropertyAll(theme.colorScheme.errorContainer.withValues(alpha: 0.4))
|
||||
? WidgetStatePropertyAll(
|
||||
theme.colorScheme.errorContainer.withValues(alpha: 0.4),
|
||||
)
|
||||
: null,
|
||||
cells: [
|
||||
for (final cell in r.cells)
|
||||
DataCell(Text(
|
||||
cell,
|
||||
style: r.highlight
|
||||
? TextStyle(color: theme.colorScheme.error)
|
||||
: null,
|
||||
)),
|
||||
DataCell(
|
||||
Text(
|
||||
cell,
|
||||
style: r.highlight
|
||||
? TextStyle(color: theme.colorScheme.error)
|
||||
: null,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
|
||||
@@ -37,11 +37,16 @@ class SampleEventsTable extends StatelessWidget {
|
||||
DataRow(
|
||||
color: e.isDuplicate
|
||||
? WidgetStatePropertyAll(
|
||||
theme.colorScheme.surfaceContainerHighest.withValues(alpha: 0.6))
|
||||
theme.colorScheme.surfaceContainerHighest.withValues(
|
||||
alpha: 0.6,
|
||||
),
|
||||
)
|
||||
: null,
|
||||
cells: [
|
||||
DataCell(Text('${e.lineNo}')),
|
||||
DataCell(Text(e.tradeDate == null ? '—' : ruDate(e.tradeDate!))),
|
||||
DataCell(
|
||||
Text(e.tradeDate == null ? '—' : ruDate(e.tradeDate!)),
|
||||
),
|
||||
DataCell(Text(eventKindLabels[e.kind] ?? e.kind)),
|
||||
DataCell(
|
||||
Tooltip(
|
||||
@@ -49,20 +54,26 @@ class SampleEventsTable extends StatelessWidget {
|
||||
child: Text(e.instrumentName ?? e.instrumentKey ?? '—'),
|
||||
),
|
||||
),
|
||||
DataCell(Text(e.quantity == null ? '—' : formatQty(e.quantity!))),
|
||||
DataCell(
|
||||
Text(e.quantity == null ? '—' : formatQty(e.quantity!)),
|
||||
),
|
||||
DataCell(Text(_money(e.price, e.currency))),
|
||||
DataCell(Text(_money(e.amount, e.currency))),
|
||||
DataCell(e.isDuplicate
|
||||
? Tooltip(
|
||||
message: 'Такое событие уже есть в леджере',
|
||||
child: Chip(
|
||||
visualDensity: VisualDensity.compact,
|
||||
label: const Text('дубль'),
|
||||
backgroundColor:
|
||||
theme.colorScheme.secondaryContainer.withValues(alpha: 0.8),
|
||||
),
|
||||
)
|
||||
: const SizedBox.shrink()),
|
||||
DataCell(
|
||||
e.isDuplicate
|
||||
? Tooltip(
|
||||
message: 'Такое событие уже есть в леджере',
|
||||
child: Chip(
|
||||
visualDensity: VisualDensity.compact,
|
||||
label: const Text('дубль'),
|
||||
backgroundColor: theme
|
||||
.colorScheme
|
||||
.secondaryContainer
|
||||
.withValues(alpha: 0.8),
|
||||
),
|
||||
)
|
||||
: const SizedBox.shrink(),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
@@ -71,5 +82,7 @@ class SampleEventsTable extends StatelessWidget {
|
||||
}
|
||||
|
||||
static String _money(String? value, String? currency) =>
|
||||
value == null || value.isEmpty ? '—' : MoneyText.format(value, currency ?? 'RUB');
|
||||
value == null || value.isEmpty
|
||||
? '—'
|
||||
: MoneyText.format(value, currency ?? 'RUB');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user