Skip to content

Commit a0ebaea

Browse files
committed
feat(bootstrap): enhance countries client with specialized filtering
- Wrap DataInMemory<Country> with CountryInMemoryClient - Add 'hasActiveSources' and 'hasActiveHeadlines' filtering capabilities - Import CountryInMemoryClient from shared/data/clients/country_inmemory_client.dart
1 parent e26dbb2 commit a0ebaea

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/bootstrap.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import 'package:flutter_news_app_mobile_client_full_source_code/app/config/confi
1818
as app_config;
1919
import 'package:flutter_news_app_mobile_client_full_source_code/app/services/demo_data_migration_service.dart';
2020
import 'package:flutter_news_app_mobile_client_full_source_code/bloc_observer.dart';
21+
import 'package:flutter_news_app_mobile_client_full_source_code/shared/data/clients/country_inmemory_client.dart';
2122
import 'package:http_client/http_client.dart';
2223
import 'package:kv_storage_shared_preferences/kv_storage_shared_preferences.dart';
2324
import 'package:logging/logging.dart';
@@ -106,6 +107,13 @@ Future<Widget> bootstrap(
106107
initialData: countriesFixturesData,
107108
logger: logger,
108109
);
110+
// Wrap the generic DataInMemory<Country> with CountryInMemoryClient
111+
// to add specialized filtering like 'hasActiveSources' and 'hasActiveHeadlines'.
112+
countriesClient = CountryInMemoryClient(
113+
decoratedClient: countriesClient,
114+
allSources: sourcesFixturesData,
115+
allHeadlines: headlinesFixturesData,
116+
);
109117
sourcesClient = DataInMemory<Source>(
110118
toJson: (i) => i.toJson(),
111119
getId: (i) => i.id,

0 commit comments

Comments
 (0)