@@ -61,6 +61,7 @@ Future<Widget> bootstrap(
61
61
HtDataClient <UserContentPreferences > userContentPreferencesClient;
62
62
HtDataClient <UserAppSettings > userAppSettingsClient;
63
63
HtDataClient <AppConfig > appConfigClient;
64
+ HtDataClient <DashboardSummary > dashboardSummaryClient;
64
65
65
66
if (appConfig.environment == app_config.AppEnvironment .demo) {
66
67
headlinesClient = HtDataInMemory <Headline >(
@@ -96,6 +97,13 @@ Future<Widget> bootstrap(
96
97
getId: (i) => i.id,
97
98
initialData: [AppConfig .fromJson (appConfigFixtureData)],
98
99
);
100
+ dashboardSummaryClient = HtDataInMemory <DashboardSummary >(
101
+ toJson: (i) => i.toJson (),
102
+ getId: (i) => i.id,
103
+ initialData: [
104
+ DashboardSummary .fromJson (dashboardSummaryFixtureData),
105
+ ],
106
+ );
99
107
} else if (appConfig.environment == app_config.AppEnvironment .development) {
100
108
headlinesClient = HtDataApi <Headline >(
101
109
httpClient: httpClient! ,
@@ -139,6 +147,12 @@ Future<Widget> bootstrap(
139
147
fromJson: AppConfig .fromJson,
140
148
toJson: (config) => config.toJson (),
141
149
);
150
+ dashboardSummaryClient = HtDataApi <DashboardSummary >(
151
+ httpClient: httpClient,
152
+ modelName: 'dashboard_summary' ,
153
+ fromJson: DashboardSummary .fromJson,
154
+ toJson: (summary) => summary.toJson (),
155
+ );
142
156
} else {
143
157
headlinesClient = HtDataApi <Headline >(
144
158
httpClient: httpClient! ,
@@ -182,6 +196,12 @@ Future<Widget> bootstrap(
182
196
fromJson: AppConfig .fromJson,
183
197
toJson: (config) => config.toJson (),
184
198
);
199
+ dashboardSummaryClient = HtDataApi <DashboardSummary >(
200
+ httpClient: httpClient,
201
+ modelName: 'dashboard_summary' ,
202
+ fromJson: DashboardSummary .fromJson,
203
+ toJson: (summary) => summary.toJson (),
204
+ );
185
205
}
186
206
187
207
final headlinesRepository = HtDataRepository <Headline >(
@@ -204,6 +224,9 @@ Future<Widget> bootstrap(
204
224
final appConfigRepository = HtDataRepository <AppConfig >(
205
225
dataClient: appConfigClient,
206
226
);
227
+ final dashboardSummaryRepository = HtDataRepository <DashboardSummary >(
228
+ dataClient: dashboardSummaryClient,
229
+ );
207
230
208
231
return App (
209
232
htAuthenticationRepository: authenticationRepository,
@@ -214,6 +237,7 @@ Future<Widget> bootstrap(
214
237
htUserAppSettingsRepository: userAppSettingsRepository,
215
238
htUserContentPreferencesRepository: userContentPreferencesRepository,
216
239
htAppConfigRepository: appConfigRepository,
240
+ htDashboardSummaryRepository: dashboardSummaryRepository,
217
241
kvStorageService: kvStorage,
218
242
environment: environment,
219
243
);
0 commit comments