Skip to content

Commit

Permalink
Rename variable api key news api
Browse files Browse the repository at this point in the history
  • Loading branch information
CoderJava committed May 29, 2020
1 parent ce9d944 commit 77c6f79
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/config/constant_config.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
class ConstantConfig {
final String apiKeyNewsApi = '3f1bdb0927c94f8da5708f7a36f7d06f';
final String keyNewsApi = '3f1bdb0927c94f8da5708f7a36f7d06f';
}
6 changes: 3 additions & 3 deletions lib/feature/data/datasource/news/news_remote_data_source.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ class NewsRemoteDataSourceImpl implements NewsRemoteDataSource {
'/v2/top-headlines',
queryParameters: {
'country': 'id',
'apiKey': constantConfig.apiKeyNewsApi,
'apiKey': constantConfig.keyNewsApi,
},
);
} else {
response = await dio.get(
'/v2/top-headlines',
queryParameters: {
'country': 'id',
'apiKey': constantConfig.apiKeyNewsApi,
'apiKey': constantConfig.keyNewsApi,
'category': category,
},
);
Expand All @@ -58,7 +58,7 @@ class NewsRemoteDataSourceImpl implements NewsRemoteDataSource {
'/v2/top-headlines',
queryParameters: {
'country': 'id',
'apiKey': constantConfig.apiKeyNewsApi,
'apiKey': constantConfig.keyNewsApi,
'q': keyword,
},
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void main() {
'/v2/top-headlines',
queryParameters: {
'country': 'id',
'apiKey': constantConfig.apiKeyNewsApi,
'apiKey': constantConfig.keyNewsApi,
},
),
);
Expand All @@ -98,7 +98,7 @@ void main() {
queryParameters: {
'category': tCategory,
'country': 'id',
'apiKey': constantConfig.apiKeyNewsApi,
'apiKey': constantConfig.keyNewsApi,
},
),
);
Expand Down Expand Up @@ -174,7 +174,7 @@ void main() {
'/v2/top-headlines',
queryParameters: {
'country': 'id',
'apiKey': constantConfig.apiKeyNewsApi,
'apiKey': constantConfig.keyNewsApi,
'q': tKeyword,
},
),
Expand Down

0 comments on commit 77c6f79

Please sign in to comment.