feat(app): новый визуальный язык, верхняя навигация, портфели, создание счетов и ручные события

Тема и общие виджеты (AssetIcon, ServiceMark, HelpTip, глоссарий), верхняя панель TopNav и вкладки Аналитики вместо NavSidebar, иконки PWA. Экраны: портфели, создание брокерского счёта, ручное событие, правка инструмента, Обзор карточками по скоупам и таблица активов, пересчёт метрик с опросом /metrics/status. design-system.md обновлён.
This commit is contained in:
Dmitry
2026-09-19 22:14:21 +03:00
parent a559d6de3e
commit 62d36aa3e8
73 changed files with 6406 additions and 1192 deletions
+12 -10
View File
@@ -15,14 +15,15 @@ import 'package:dio/dio.dart';
import '../auth/auth_controller.dart' show problemMessage;
String? asString(Object? v) => v == null ? null : (v is String ? v : v.toString());
String? asString(Object? v) =>
v == null ? null : (v is String ? v : v.toString());
int? asInt(Object? v) => switch (v) {
null => null,
final int i => i,
final String s => int.tryParse(s),
_ => null,
};
null => null,
final int i => i,
final String s => int.tryParse(s),
_ => null,
};
bool asBool(Object? v) => v == true;
@@ -53,7 +54,8 @@ List<Map<String, dynamic>> asObjects(Object? v) => v is List
? v.whereType<Map>().map((e) => Map<String, dynamic>.from(e)).toList()
: const [];
Map<String, dynamic>? asObject(Object? v) => v is Map ? Map<String, dynamic>.from(v) : null;
Map<String, dynamic>? asObject(Object? v) =>
v is Map ? Map<String, dynamic>.from(v) : null;
List<String> asStrings(Object? v) =>
v is List ? v.map((e) => e.toString()).toList() : const <String>[];
@@ -74,9 +76,9 @@ Decimal? asDecimal(Object? v) {
/// Sum of decimal strings, exact — used for weight sums, where 0.1 + 0.2 in `double`
/// would make a valid set look invalid.
Decimal sumDecimals(Iterable<String> values) => values.fold(
Decimal.zero,
(acc, v) => acc + (Decimal.tryParse(v) ?? Decimal.zero),
);
Decimal.zero,
(acc, v) => acc + (Decimal.tryParse(v) ?? Decimal.zero),
);
/// RFC 7807 `detail` first, then a readable fallback. Never surfaces a raw [DioException].
String apiErrorMessage(Object error) {
+2 -1
View File
@@ -43,7 +43,8 @@ String ruMonthYear(DateTime d) {
String ruMonthYearShort(DateTime d) => '${_monthsShort[d.month - 1]} ${d.year}';
/// `'2026-09'`, the `month` query parameter format the API expects.
String monthKey(DateTime d) => '${d.year.toString().padLeft(4, '0')}-${d.month.toString().padLeft(2, '0')}';
String monthKey(DateTime d) =>
'${d.year.toString().padLeft(4, '0')}-${d.month.toString().padLeft(2, '0')}';
/// Parses a `'YYYY-MM'` key back into a [DateTime] (first of month, UTC).
DateTime parseMonthKey(String key) {