style(app): остальные экраны под новый визуальный язык и форматирование
Доходы, ребалансировка, налоги, импорт, цели, здоровье данных, правила, транзакции, категории, cashflow, pending: новые виджеты и токены темы, dart format. Тесты подстроены под новые модели.
This commit is contained in:
@@ -62,7 +62,9 @@ class RebalancePlanTab extends ConsumerWidget {
|
||||
child: const ListTile(
|
||||
leading: Icon(Icons.check_circle_outline),
|
||||
title: Text('Все группы внутри коридора'),
|
||||
subtitle: Text('Действий не требуется — отклонения меньше заданного допуска.'),
|
||||
subtitle: Text(
|
||||
'Действий не требуется — отклонения меньше заданного допуска.',
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
@@ -104,7 +106,9 @@ class _Header extends ConsumerWidget {
|
||||
: MoneyText(plan.totalValueRub!, currency: 'RUB'),
|
||||
),
|
||||
_Figure(
|
||||
label: whatIf == null ? 'Доступно денег' : 'Доступно денег (what-if)',
|
||||
label: whatIf == null
|
||||
? 'Доступно денег'
|
||||
: 'Доступно денег (what-if)',
|
||||
child: plan.cashAvailableRub == null
|
||||
? const Text('—')
|
||||
: MoneyText(plan.cashAvailableRub!, currency: 'RUB'),
|
||||
@@ -149,8 +153,9 @@ class _WhatIfCashField extends ConsumerStatefulWidget {
|
||||
}
|
||||
|
||||
class _WhatIfCashFieldState extends ConsumerState<_WhatIfCashField> {
|
||||
late final TextEditingController _controller =
|
||||
TextEditingController(text: widget.current ?? '');
|
||||
late final TextEditingController _controller = TextEditingController(
|
||||
text: widget.current ?? '',
|
||||
);
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
@@ -159,7 +164,10 @@ class _WhatIfCashFieldState extends ConsumerState<_WhatIfCashField> {
|
||||
}
|
||||
|
||||
void _apply() {
|
||||
final text = _controller.text.trim().replaceAll(',', '.').replaceAll(' ', '');
|
||||
final text = _controller.text
|
||||
.trim()
|
||||
.replaceAll(',', '.')
|
||||
.replaceAll(' ', '');
|
||||
ref.read(whatIfCashProvider.notifier).state = text.isEmpty ? null : text;
|
||||
}
|
||||
|
||||
@@ -228,30 +236,35 @@ class _BucketCard extends StatelessWidget {
|
||||
final theme = Theme.of(context);
|
||||
return SectionCard(
|
||||
title: bucketLabelForKey(dimension, bucket.bucket),
|
||||
subtitle: 'сейчас ${formatShareAsPercent(bucket.currentWeight)} · '
|
||||
subtitle:
|
||||
'сейчас ${formatShareAsPercent(bucket.currentWeight)} · '
|
||||
'цель ${formatShareAsPercent(bucket.targetWeight)} · '
|
||||
'отклонение ${formatShareAsPercent(bucket.drift, signed: true)}',
|
||||
trailing: bucket.withinBand
|
||||
? const _WithinBandChip()
|
||||
: (bucket.deltaValueRub == null
|
||||
? const Text('—')
|
||||
: MoneyText(
|
||||
bucket.deltaValueRub!,
|
||||
currency: 'RUB',
|
||||
style: TextStyle(color: signColor(context, bucket.deltaValueRub)),
|
||||
)),
|
||||
? const Text('—')
|
||||
: MoneyText(
|
||||
bucket.deltaValueRub!,
|
||||
currency: 'RUB',
|
||||
style: TextStyle(
|
||||
color: signColor(context, bucket.deltaValueRub),
|
||||
),
|
||||
)),
|
||||
child: bucket.withinBand
|
||||
? Text(
|
||||
'Внутри коридора — сделок не требуется.',
|
||||
style: theme.textTheme.bodySmall,
|
||||
)
|
||||
: bucket.trades.isEmpty
|
||||
? Text(
|
||||
'Сервер не предложил сделок по этой группе: '
|
||||
'вероятно, у подходящих бумаг нет цены — см. предупреждения выше.',
|
||||
style: theme.textTheme.bodySmall,
|
||||
)
|
||||
: Column(children: [for (final t in bucket.trades) TradeRow(trade: t)]),
|
||||
? Text(
|
||||
'Сервер не предложил сделок по этой группе: '
|
||||
'вероятно, у подходящих бумаг нет цены — см. предупреждения выше.',
|
||||
style: theme.textTheme.bodySmall,
|
||||
)
|
||||
: Column(
|
||||
children: [for (final t in bucket.trades) TradeRow(trade: t)],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -301,7 +314,9 @@ class TradeRow extends StatelessWidget {
|
||||
: () => context.push('/portfolio/instrument/${trade.instrumentId}'),
|
||||
leading: Icon(
|
||||
isBuy ? Icons.add_circle_outline : Icons.remove_circle_outline,
|
||||
color: isBuy ? Theme.of(context).colorScheme.primary : theme.colorScheme.error,
|
||||
color: isBuy
|
||||
? Theme.of(context).colorScheme.primary
|
||||
: theme.colorScheme.error,
|
||||
),
|
||||
title: Row(
|
||||
children: [
|
||||
@@ -315,12 +330,16 @@ class TradeRow extends StatelessWidget {
|
||||
noQty
|
||||
? 'Количество не рассчитано: нет цены инструмента'
|
||||
: '${isBuy ? 'Купить' : 'Продать'} ${formatQty(trade.suggestedQty!)} шт.'
|
||||
'${details.isEmpty ? '' : ' · $details'}',
|
||||
'${details.isEmpty ? '' : ' · $details'}',
|
||||
style: theme.textTheme.bodySmall,
|
||||
),
|
||||
trailing: noQty || trade.amountRub == null
|
||||
? const Text('—')
|
||||
: MoneyText(trade.amountRub!, currency: 'RUB', style: theme.textTheme.titleSmall),
|
||||
: MoneyText(
|
||||
trade.amountRub!,
|
||||
currency: 'RUB',
|
||||
style: theme.textTheme.titleSmall,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user