1
1
//
2
2
// ignore_for_file: deprecated_member_use
3
3
4
+ import 'package:auth_repository/auth_repository.dart' ;
5
+ import 'package:core/core.dart' hide AppStatus;
6
+ // Import for app_theme.dart
7
+ import 'package:data_repository/data_repository.dart' ;
4
8
import 'package:flex_color_scheme/flex_color_scheme.dart' ;
5
9
import 'package:flutter/material.dart' ;
6
10
import 'package:flutter_bloc/flutter_bloc.dart' ;
11
+ import 'package:flutter_news_app_web_dashboard_full_source_code/app/bloc/app_bloc.dart' ;
12
+ import 'package:flutter_news_app_web_dashboard_full_source_code/app/config/app_environment.dart' ;
13
+ import 'package:flutter_news_app_web_dashboard_full_source_code/app_configuration/bloc/app_configuration_bloc.dart' ;
14
+ import 'package:flutter_news_app_web_dashboard_full_source_code/authentication/bloc/authentication_bloc.dart' ;
15
+ import 'package:flutter_news_app_web_dashboard_full_source_code/content_management/bloc/content_management_bloc.dart' ;
16
+ import 'package:flutter_news_app_web_dashboard_full_source_code/dashboard/bloc/dashboard_bloc.dart' ;
17
+ import 'package:flutter_news_app_web_dashboard_full_source_code/l10n/app_localizations.dart' ;
18
+ import 'package:flutter_news_app_web_dashboard_full_source_code/router/router.dart' ;
7
19
import 'package:go_router/go_router.dart' ;
8
- import 'package:ht_auth_repository/ht_auth_repository.dart' ;
9
- import 'package:ht_dashboard/app/bloc/app_bloc.dart' ;
10
- import 'package:ht_dashboard/app/config/app_environment.dart' ;
11
- import 'package:ht_dashboard/app_configuration/bloc/app_configuration_bloc.dart' ;
12
- import 'package:ht_dashboard/authentication/bloc/authentication_bloc.dart' ;
13
- import 'package:ht_dashboard/content_management/bloc/content_management_bloc.dart' ;
14
- import 'package:ht_dashboard/dashboard/bloc/dashboard_bloc.dart' ;
15
- import 'package:ht_dashboard/l10n/app_localizations.dart' ;
16
- import 'package:ht_dashboard/router/router.dart' ;
17
- // Import for app_theme.dart
18
- import 'package:ht_data_repository/ht_data_repository.dart' ;
19
- import 'package:ht_kv_storage_service/ht_kv_storage_service.dart' ;
20
- import 'package:ht_shared/ht_shared.dart' hide AppStatus;
21
- import 'package:ht_ui_kit/ht_ui_kit.dart' ;
20
+ import 'package:kv_storage_service/kv_storage_service.dart' ;
22
21
import 'package:logging/logging.dart' ;
22
+ import 'package:ui_kit/ui_kit.dart' ;
23
23
24
24
class App extends StatelessWidget {
25
25
const App ({
26
- required HtAuthRepository htAuthenticationRepository ,
27
- required HtDataRepository <Headline > htHeadlinesRepository ,
28
- required HtDataRepository <Topic > htTopicsRepository ,
29
- required HtDataRepository <Country > htCountriesRepository ,
30
- required HtDataRepository <Source > htSourcesRepository ,
31
- required HtDataRepository <UserAppSettings > htUserAppSettingsRepository ,
32
- required HtDataRepository <UserContentPreferences >
33
- htUserContentPreferencesRepository ,
34
- required HtDataRepository <RemoteConfig > htRemoteConfigRepository ,
35
- required HtDataRepository <DashboardSummary > htDashboardSummaryRepository ,
36
- required HtKVStorageService kvStorageService ,
26
+ required AuthRepository authenticationRepository ,
27
+ required DataRepository <Headline > headlinesRepository ,
28
+ required DataRepository <Topic > topicsRepository ,
29
+ required DataRepository <Country > countriesRepository ,
30
+ required DataRepository <Source > sourcesRepository ,
31
+ required DataRepository <UserAppSettings > userAppSettingsRepository ,
32
+ required DataRepository <UserContentPreferences >
33
+ userContentPreferencesRepository ,
34
+ required DataRepository <RemoteConfig > remoteConfigRepository ,
35
+ required DataRepository <DashboardSummary > dashboardSummaryRepository ,
36
+ required KVStorageService storageService ,
37
37
required AppEnvironment environment,
38
38
super .key,
39
- }) : _htAuthenticationRepository = htAuthenticationRepository ,
40
- _htHeadlinesRepository = htHeadlinesRepository ,
41
- _htTopicsRepository = htTopicsRepository ,
42
- _htCountriesRepository = htCountriesRepository ,
43
- _htSourcesRepository = htSourcesRepository ,
44
- _htUserAppSettingsRepository = htUserAppSettingsRepository ,
45
- _htUserContentPreferencesRepository = htUserContentPreferencesRepository ,
46
- _htRemoteConfigRepository = htRemoteConfigRepository ,
47
- _kvStorageService = kvStorageService ,
48
- _htDashboardSummaryRepository = htDashboardSummaryRepository ,
39
+ }) : _authenticationRepository = authenticationRepository ,
40
+ _headlinesRepository = headlinesRepository ,
41
+ _topicsRepository = topicsRepository ,
42
+ _countriesRepository = countriesRepository ,
43
+ _sourcesRepository = sourcesRepository ,
44
+ _userAppSettingsRepository = userAppSettingsRepository ,
45
+ _userContentPreferencesRepository = userContentPreferencesRepository ,
46
+ _remoteConfigRepository = remoteConfigRepository ,
47
+ _kvStorageService = storageService ,
48
+ _dashboardSummaryRepository = dashboardSummaryRepository ,
49
49
_environment = environment;
50
50
51
- final HtAuthRepository _htAuthenticationRepository ;
52
- final HtDataRepository <Headline > _htHeadlinesRepository ;
53
- final HtDataRepository <Topic > _htTopicsRepository ;
54
- final HtDataRepository <Country > _htCountriesRepository ;
55
- final HtDataRepository <Source > _htSourcesRepository ;
56
- final HtDataRepository <UserAppSettings > _htUserAppSettingsRepository ;
57
- final HtDataRepository <UserContentPreferences >
58
- _htUserContentPreferencesRepository ;
59
- final HtDataRepository <RemoteConfig > _htRemoteConfigRepository ;
60
- final HtDataRepository <DashboardSummary > _htDashboardSummaryRepository ;
61
- final HtKVStorageService _kvStorageService;
51
+ final AuthRepository _authenticationRepository ;
52
+ final DataRepository <Headline > _headlinesRepository ;
53
+ final DataRepository <Topic > _topicsRepository ;
54
+ final DataRepository <Country > _countriesRepository ;
55
+ final DataRepository <Source > _sourcesRepository ;
56
+ final DataRepository <UserAppSettings > _userAppSettingsRepository ;
57
+ final DataRepository <UserContentPreferences >
58
+ _userContentPreferencesRepository ;
59
+ final DataRepository <RemoteConfig > _remoteConfigRepository ;
60
+ final DataRepository <DashboardSummary > _dashboardSummaryRepository ;
61
+ final KVStorageService _kvStorageService;
62
62
final AppEnvironment _environment;
63
63
64
64
@override
65
65
Widget build (BuildContext context) {
66
66
return MultiRepositoryProvider (
67
67
providers: [
68
- RepositoryProvider .value (value: _htAuthenticationRepository ),
69
- RepositoryProvider .value (value: _htHeadlinesRepository ),
70
- RepositoryProvider .value (value: _htTopicsRepository ),
71
- RepositoryProvider .value (value: _htCountriesRepository ),
72
- RepositoryProvider .value (value: _htSourcesRepository ),
73
- RepositoryProvider .value (value: _htUserAppSettingsRepository ),
74
- RepositoryProvider .value (value: _htUserContentPreferencesRepository ),
75
- RepositoryProvider .value (value: _htRemoteConfigRepository ),
76
- RepositoryProvider .value (value: _htDashboardSummaryRepository ),
68
+ RepositoryProvider .value (value: _authenticationRepository ),
69
+ RepositoryProvider .value (value: _headlinesRepository ),
70
+ RepositoryProvider .value (value: _topicsRepository ),
71
+ RepositoryProvider .value (value: _countriesRepository ),
72
+ RepositoryProvider .value (value: _sourcesRepository ),
73
+ RepositoryProvider .value (value: _userAppSettingsRepository ),
74
+ RepositoryProvider .value (value: _userContentPreferencesRepository ),
75
+ RepositoryProvider .value (value: _remoteConfigRepository ),
76
+ RepositoryProvider .value (value: _dashboardSummaryRepository ),
77
77
RepositoryProvider .value (value: _kvStorageService),
78
78
],
79
79
child: MultiBlocProvider (
80
80
providers: [
81
81
BlocProvider (
82
82
create: (context) => AppBloc (
83
- authenticationRepository: context.read <HtAuthRepository >(),
83
+ authenticationRepository: context.read <AuthRepository >(),
84
84
userAppSettingsRepository: context
85
- .read <HtDataRepository <UserAppSettings >>(),
86
- appConfigRepository: context
87
- .read <HtDataRepository <RemoteConfig >>(),
85
+ .read <DataRepository <UserAppSettings >>(),
86
+ appConfigRepository: context.read <DataRepository <RemoteConfig >>(),
88
87
environment: _environment,
89
88
logger: Logger ('AppBloc' ),
90
89
),
91
90
),
92
91
BlocProvider (
93
92
create: (context) => AuthenticationBloc (
94
- authenticationRepository: context.read <HtAuthRepository >(),
93
+ authenticationRepository: context.read <AuthRepository >(),
95
94
),
96
95
),
97
96
BlocProvider (
98
97
create: (context) => AppConfigurationBloc (
99
98
remoteConfigRepository: context
100
- .read <HtDataRepository <RemoteConfig >>(),
99
+ .read <DataRepository <RemoteConfig >>(),
101
100
),
102
101
),
103
102
BlocProvider (
104
103
create: (context) => ContentManagementBloc (
105
- headlinesRepository: context.read <HtDataRepository <Headline >>(),
106
- topicsRepository: context.read <HtDataRepository <Topic >>(),
107
- sourcesRepository: context.read <HtDataRepository <Source >>(),
104
+ headlinesRepository: context.read <DataRepository <Headline >>(),
105
+ topicsRepository: context.read <DataRepository <Topic >>(),
106
+ sourcesRepository: context.read <DataRepository <Source >>(),
108
107
),
109
108
),
110
109
BlocProvider (
111
110
create: (context) => DashboardBloc (
112
111
dashboardSummaryRepository: context
113
- .read <HtDataRepository <DashboardSummary >>(),
114
- headlinesRepository: context.read <HtDataRepository <Headline >>(),
112
+ .read <DataRepository <DashboardSummary >>(),
113
+ headlinesRepository: context.read <DataRepository <Headline >>(),
115
114
),
116
115
),
117
116
],
118
117
child: _AppView (
119
- htAuthenticationRepository : _htAuthenticationRepository ,
118
+ authenticationRepository : _authenticationRepository ,
120
119
environment: _environment,
121
120
),
122
121
),
@@ -127,11 +126,11 @@ class App extends StatelessWidget {
127
126
class _AppView extends StatefulWidget {
128
127
/// {@macro app_view}
129
128
const _AppView ({
130
- required this .htAuthenticationRepository ,
129
+ required this .authenticationRepository ,
131
130
required this .environment,
132
131
});
133
132
134
- final HtAuthRepository htAuthenticationRepository ;
133
+ final AuthRepository authenticationRepository ;
135
134
final AppEnvironment environment;
136
135
137
136
@override
@@ -149,7 +148,7 @@ class _AppViewState extends State<_AppView> {
149
148
_statusNotifier = ValueNotifier <AppStatus >(appBloc.state.status);
150
149
_router = createRouter (
151
150
authStatusNotifier: _statusNotifier,
152
- htAuthenticationRepository : widget.htAuthenticationRepository ,
151
+ authenticationRepository : widget.authenticationRepository ,
153
152
environment: widget.environment,
154
153
);
155
154
}
@@ -210,10 +209,10 @@ class _AppViewState extends State<_AppView> {
210
209
debugShowCheckedModeBanner: false ,
211
210
routerConfig: _router,
212
211
localizationsDelegates: const [
213
- HtUiKitLocalizations .delegate,
212
+ UiKitLocalizations .delegate,
214
213
...AppLocalizations .localizationsDelegates,
215
214
],
216
- supportedLocales: HtUiKitLocalizations .supportedLocales,
215
+ supportedLocales: UiKitLocalizations .supportedLocales,
217
216
theme: baseTheme == AppBaseTheme .dark
218
217
? darkThemeData
219
218
: lightThemeData,
0 commit comments