style(app): остальные экраны под новый визуальный язык и форматирование
Доходы, ребалансировка, налоги, импорт, цели, здоровье данных, правила, транзакции, категории, cashflow, pending: новые виджеты и токены темы, dart format. Тесты подстроены под новые модели.
This commit is contained in:
@@ -77,7 +77,10 @@ class IncomeHistoryTab extends ConsumerWidget {
|
||||
scrollDirection: Axis.horizontal,
|
||||
reverse: true,
|
||||
child: SizedBox(
|
||||
width: (months.length * 44).toDouble().clamp(320, double.infinity),
|
||||
width: (months.length * 44).toDouble().clamp(
|
||||
320,
|
||||
double.infinity,
|
||||
),
|
||||
child: _HistoryChart(months: months),
|
||||
),
|
||||
),
|
||||
@@ -109,7 +112,8 @@ class _PeriodChips extends ConsumerWidget {
|
||||
ChoiceChip(
|
||||
label: Text(m >= 120 ? 'Всё время' : '$m мес'),
|
||||
selected: months == m,
|
||||
onSelected: (_) => ref.read(historyMonthsProvider.notifier).state = m,
|
||||
onSelected: (_) =>
|
||||
ref.read(historyMonthsProvider.notifier).state = m,
|
||||
),
|
||||
],
|
||||
);
|
||||
@@ -130,7 +134,9 @@ List<_MonthTotal> _byMonth(List<IncomeHistoryRow> rows) {
|
||||
final m = r.month;
|
||||
if (m == null) continue;
|
||||
final key = DateTime.utc(m.year, m.month);
|
||||
sums[key] = (sums[key] ?? Decimal.zero) + (Decimal.tryParse(r.amountRub ?? '') ?? Decimal.zero);
|
||||
sums[key] =
|
||||
(sums[key] ?? Decimal.zero) +
|
||||
(Decimal.tryParse(r.amountRub ?? '') ?? Decimal.zero);
|
||||
}
|
||||
final keys = sums.keys.toList()..sort();
|
||||
return [for (final k in keys) _MonthTotal(k, sums[k]!)];
|
||||
@@ -166,8 +172,12 @@ class _HistoryChart extends StatelessWidget {
|
||||
getTitlesWidget: (value, meta) {
|
||||
final i = value.round();
|
||||
if (i < 0 || i >= months.length) return const SizedBox.shrink();
|
||||
if (months.length > 14 && i % 3 != 0) return const SizedBox.shrink();
|
||||
return Text(ruMonthYearShort(months[i].month), style: theme.textTheme.bodySmall);
|
||||
if (months.length > 14 && i % 3 != 0)
|
||||
return const SizedBox.shrink();
|
||||
return Text(
|
||||
ruMonthYearShort(months[i].month),
|
||||
style: theme.textTheme.bodySmall,
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
@@ -190,7 +200,9 @@ class _HistoryChart extends StatelessWidget {
|
||||
toY: months[i].amountRub.toDouble(),
|
||||
color: basisColor('paid'),
|
||||
width: 12,
|
||||
borderRadius: const BorderRadius.vertical(top: Radius.circular(2)),
|
||||
borderRadius: const BorderRadius.vertical(
|
||||
top: Radius.circular(2),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -216,7 +228,10 @@ class _HistoryTable extends StatelessWidget {
|
||||
DataColumn(label: Text('Тип', style: headerStyle)),
|
||||
DataColumn(label: Text('Валюта', style: headerStyle)),
|
||||
DataColumn(label: Text('Сумма', style: headerStyle), numeric: true),
|
||||
DataColumn(label: Text('В рублях', style: headerStyle), numeric: true),
|
||||
DataColumn(
|
||||
label: Text('В рублях', style: headerStyle),
|
||||
numeric: true,
|
||||
),
|
||||
DataColumn(label: Text('Налог', style: headerStyle), numeric: true),
|
||||
DataColumn(label: Text('Выплат', style: headerStyle), numeric: true),
|
||||
],
|
||||
@@ -224,16 +239,22 @@ class _HistoryTable extends StatelessWidget {
|
||||
for (final r in rows)
|
||||
DataRow(
|
||||
cells: [
|
||||
DataCell(Text(r.month == null ? '—' : ruMonthYearShort(r.month!))),
|
||||
DataCell(
|
||||
Text(r.month == null ? '—' : ruMonthYearShort(r.month!)),
|
||||
),
|
||||
DataCell(Text(incomeKindLabel(r.kind))),
|
||||
DataCell(Text(r.currency)),
|
||||
DataCell(MoneyText(r.amount, currency: r.currency)),
|
||||
DataCell(r.amountRub == null
|
||||
? const Text('—')
|
||||
: MoneyText(r.amountRub!, currency: 'RUB')),
|
||||
DataCell(r.taxWithheld == null
|
||||
? const Text('—')
|
||||
: MoneyText(r.taxWithheld!, currency: r.currency)),
|
||||
DataCell(
|
||||
r.amountRub == null
|
||||
? const Text('—')
|
||||
: MoneyText(r.amountRub!, currency: 'RUB'),
|
||||
),
|
||||
DataCell(
|
||||
r.taxWithheld == null
|
||||
? const Text('—')
|
||||
: MoneyText(r.taxWithheld!, currency: r.currency),
|
||||
),
|
||||
DataCell(Text('${r.paymentCount}')),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user