From 77c6f79822a169eda5237d92d1b8853b12828f23 Mon Sep 17 00:00:00 2001 From: Yudi Setiawan Date: Fri, 29 May 2020 13:43:37 +0700 Subject: [PATCH] Rename variable api key news api --- lib/config/constant_config.dart | 2 +- .../data/datasource/news/news_remote_data_source.dart | 6 +++--- .../data/datasource/news/news_remote_data_source_test.dart | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/config/constant_config.dart b/lib/config/constant_config.dart index 273aa87..4404823 100644 --- a/lib/config/constant_config.dart +++ b/lib/config/constant_config.dart @@ -1,3 +1,3 @@ class ConstantConfig { - final String apiKeyNewsApi = '3f1bdb0927c94f8da5708f7a36f7d06f'; + final String keyNewsApi = '3f1bdb0927c94f8da5708f7a36f7d06f'; } \ No newline at end of file diff --git a/lib/feature/data/datasource/news/news_remote_data_source.dart b/lib/feature/data/datasource/news/news_remote_data_source.dart index 1eb3bbf..b4ccc0b 100644 --- a/lib/feature/data/datasource/news/news_remote_data_source.dart +++ b/lib/feature/data/datasource/news/news_remote_data_source.dart @@ -32,7 +32,7 @@ class NewsRemoteDataSourceImpl implements NewsRemoteDataSource { '/v2/top-headlines', queryParameters: { 'country': 'id', - 'apiKey': constantConfig.apiKeyNewsApi, + 'apiKey': constantConfig.keyNewsApi, }, ); } else { @@ -40,7 +40,7 @@ class NewsRemoteDataSourceImpl implements NewsRemoteDataSource { '/v2/top-headlines', queryParameters: { 'country': 'id', - 'apiKey': constantConfig.apiKeyNewsApi, + 'apiKey': constantConfig.keyNewsApi, 'category': category, }, ); @@ -58,7 +58,7 @@ class NewsRemoteDataSourceImpl implements NewsRemoteDataSource { '/v2/top-headlines', queryParameters: { 'country': 'id', - 'apiKey': constantConfig.apiKeyNewsApi, + 'apiKey': constantConfig.keyNewsApi, 'q': keyword, }, ); diff --git a/test/feature/data/datasource/news/news_remote_data_source_test.dart b/test/feature/data/datasource/news/news_remote_data_source_test.dart index 40733e7..91e5a55 100644 --- a/test/feature/data/datasource/news/news_remote_data_source_test.dart +++ b/test/feature/data/datasource/news/news_remote_data_source_test.dart @@ -75,7 +75,7 @@ void main() { '/v2/top-headlines', queryParameters: { 'country': 'id', - 'apiKey': constantConfig.apiKeyNewsApi, + 'apiKey': constantConfig.keyNewsApi, }, ), ); @@ -98,7 +98,7 @@ void main() { queryParameters: { 'category': tCategory, 'country': 'id', - 'apiKey': constantConfig.apiKeyNewsApi, + 'apiKey': constantConfig.keyNewsApi, }, ), ); @@ -174,7 +174,7 @@ void main() { '/v2/top-headlines', queryParameters: { 'country': 'id', - 'apiKey': constantConfig.apiKeyNewsApi, + 'apiKey': constantConfig.keyNewsApi, 'q': tKeyword, }, ),