feat(app): offline-кэш на остальных экранах — фаза 5
accounts, cashflow, categories, goals, income, portfolio (+instrument), rebalance, tax, rules переведены на Cached<T> по контракту docs/ai/offline-cache.md. Общие/второстепенные селекторы (scopesProvider, categoriesListProvider и т.п.) оставлены как есть — не основной контент экрана. sync_page.dart и settings_page.dart не тронуты (первый — заменён health-page отдельно, второй — чистые действия без списка для баннера).
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
import 'package:fintracker_api/fintracker_api.dart';
|
||||
import 'package:fintracker_app/core/cache/cached.dart';
|
||||
import 'package:fintracker_app/core/widgets/money_text.dart';
|
||||
import 'package:fintracker_app/features/portfolio/allocation_tab.dart';
|
||||
import 'package:fintracker_app/features/portfolio/benchmarks_card.dart';
|
||||
import 'package:fintracker_app/features/portfolio/data/benchmarks_api.dart';
|
||||
import 'package:fintracker_app/features/portfolio/holdings_tab.dart';
|
||||
import 'package:fintracker_app/features/portfolio/labels.dart';
|
||||
import 'package:fintracker_app/features/portfolio/providers.dart';
|
||||
@@ -82,13 +85,16 @@ void main() {
|
||||
await pumpTall(tester, _wrap(
|
||||
const HoldingsTab(),
|
||||
[
|
||||
portfolioSummaryProvider.overrideWith((ref) => summary()),
|
||||
valueSeriesProvider.overrideWith((ref) => const <ValueDay>[]),
|
||||
portfolioReturnsProvider.overrideWith((ref) => const <ReturnsOut>[]),
|
||||
holdingsProvider.overrideWith((ref) => [
|
||||
portfolioSummaryProvider.overrideWith((ref) => Cached(summary())),
|
||||
valueSeriesProvider.overrideWith((ref) => const Cached(<ValueDay>[])),
|
||||
portfolioReturnsProvider.overrideWith((ref) => const Cached(<ReturnsOut>[])),
|
||||
holdingsProvider.overrideWith((ref) => Cached([
|
||||
holding(id: 1, ticker: 'GAZP', valueRub: '11000', weight: '1'),
|
||||
holding(id: 2, ticker: 'SIBN6P4', priceStatus: 'missing'),
|
||||
]),
|
||||
])),
|
||||
// HoldingsTab embeds BenchmarksCard, which watches this too — leaving it out would
|
||||
// fall through to the real apiProvider (see docs/ai/offline-cache.md).
|
||||
benchmarkRowsProvider.overrideWith((ref) => const Cached(<BenchmarkRow>[])),
|
||||
],
|
||||
));
|
||||
|
||||
@@ -105,10 +111,11 @@ void main() {
|
||||
await pumpTall(tester, _wrap(
|
||||
const HoldingsTab(),
|
||||
[
|
||||
portfolioSummaryProvider.overrideWith((ref) => summary()),
|
||||
valueSeriesProvider.overrideWith((ref) => const <ValueDay>[]),
|
||||
portfolioReturnsProvider.overrideWith((ref) => const <ReturnsOut>[]),
|
||||
holdingsProvider.overrideWith((ref) => const <HoldingOut>[]),
|
||||
portfolioSummaryProvider.overrideWith((ref) => Cached(summary())),
|
||||
valueSeriesProvider.overrideWith((ref) => const Cached(<ValueDay>[])),
|
||||
portfolioReturnsProvider.overrideWith((ref) => const Cached(<ReturnsOut>[])),
|
||||
holdingsProvider.overrideWith((ref) => const Cached(<HoldingOut>[])),
|
||||
benchmarkRowsProvider.overrideWith((ref) => const Cached(<BenchmarkRow>[])),
|
||||
],
|
||||
));
|
||||
|
||||
@@ -120,7 +127,7 @@ void main() {
|
||||
await pumpTall(tester, _wrap(
|
||||
const AllocationTab(),
|
||||
[
|
||||
allocationProvider.overrideWith((ref) => [
|
||||
allocationProvider.overrideWith((ref) => Cached([
|
||||
AllocationBucket(
|
||||
bucket: 'share',
|
||||
dimension: AllocationDimension.assetClass,
|
||||
@@ -135,7 +142,7 @@ void main() {
|
||||
valueRub: '5700',
|
||||
weight: '0.3413',
|
||||
),
|
||||
]),
|
||||
])),
|
||||
],
|
||||
));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user