Skip to content

Commit 951040d

Browse files
committed
feat(router): implement followed countries list and add country route
- Add GoRoute for followedCountriesList and addCountryToFollow - Uncomment import statements for available_countries_bloc and country-related pages - Uncomment routes for country filter and followed countries list - Update Routes class to include country-related routes
1 parent f4cb2fd commit 951040d

File tree

2 files changed

+21
-7
lines changed

2 files changed

+21
-7
lines changed

lib/router/router.dart

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ import 'package:flutter_news_app_mobile_client_full_source_code/account/bloc/acc
77
import 'package:flutter_news_app_mobile_client_full_source_code/account/view/account_page.dart';
88
import 'package:flutter_news_app_mobile_client_full_source_code/account/view/manage_followed_items/manage_followed_items_page.dart';
99
import 'package:flutter_news_app_mobile_client_full_source_code/account/view/manage_followed_items/sources/add_source_to_follow_page.dart';
10+
import 'package:flutter_news_app_mobile_client_full_source_code/account/bloc/available_countries_bloc.dart';
11+
import 'package:flutter_news_app_mobile_client_full_source_code/account/view/manage_followed_items/countries/add_country_to_follow_page.dart';
12+
import 'package:flutter_news_app_mobile_client_full_source_code/account/view/manage_followed_items/countries/followed_countries_list_page.dart';
1013
import 'package:flutter_news_app_mobile_client_full_source_code/account/view/manage_followed_items/sources/followed_sources_list_page.dart';
1114
import 'package:flutter_news_app_mobile_client_full_source_code/account/view/manage_followed_items/topics/add_topic_to_follow_page.dart';
1215
import 'package:flutter_news_app_mobile_client_full_source_code/account/view/manage_followed_items/topics/followed_topics_list_page.dart';
@@ -25,12 +28,10 @@ import 'package:flutter_news_app_mobile_client_full_source_code/headline-details
2528
import 'package:flutter_news_app_mobile_client_full_source_code/headline-details/bloc/similar_headlines_bloc.dart';
2629
import 'package:flutter_news_app_mobile_client_full_source_code/headline-details/view/headline_details_page.dart';
2730
import 'package:flutter_news_app_mobile_client_full_source_code/headlines-feed/bloc/countries_filter_bloc.dart';
28-
// import 'package:flutter_news_app_mobile_client_full_source_code/headlines-feed/bloc/countries_filter_bloc.dart';
2931
import 'package:flutter_news_app_mobile_client_full_source_code/headlines-feed/bloc/headlines_feed_bloc.dart';
3032
import 'package:flutter_news_app_mobile_client_full_source_code/headlines-feed/bloc/sources_filter_bloc.dart';
3133
import 'package:flutter_news_app_mobile_client_full_source_code/headlines-feed/bloc/topics_filter_bloc.dart';
3234
import 'package:flutter_news_app_mobile_client_full_source_code/headlines-feed/view/country_filter_page.dart';
33-
// import 'package:flutter_news_app_mobile_client_full_source_code/headlines-feed/view/country_filter_page.dart';
3435
import 'package:flutter_news_app_mobile_client_full_source_code/headlines-feed/view/headlines_feed_page.dart';
3536
import 'package:flutter_news_app_mobile_client_full_source_code/headlines-feed/view/headlines_filter_page.dart';
3637
import 'package:flutter_news_app_mobile_client_full_source_code/headlines-feed/view/source_filter_page.dart';
@@ -726,7 +727,20 @@ GoRouter createRouter({
726727
),
727728
],
728729
),
729-
// GoRoute for followedCountriesList removed
730+
GoRoute(
731+
path: Routes.followedCountriesList,
732+
name: Routes.followedCountriesListName,
733+
builder: (context, state) =>
734+
const FollowedCountriesListPage(),
735+
routes: [
736+
GoRoute(
737+
path: Routes.addCountryToFollow,
738+
name: Routes.addCountryToFollowName,
739+
builder: (context, state) =>
740+
const AddCountryToFollowPage(),
741+
),
742+
],
743+
),
730744
],
731745
),
732746
GoRoute(

lib/router/routes.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ abstract final class Routes {
120120
static const addSourceToFollow = 'add-source';
121121
static const addSourceToFollowName = 'addSourceToFollow';
122122

123-
// static const followedCountriesList = 'countries';
124-
// static const followedCountriesListName = 'followedCountriesList';
125-
// static const addCountryToFollow = 'add-country';
126-
// static const addCountryToFollowName = 'addCountryToFollow';
123+
static const followedCountriesList = 'countries';
124+
static const followedCountriesListName = 'followedCountriesList';
125+
static const addCountryToFollow = 'add-country';
126+
static const addCountryToFollowName = 'addCountryToFollow';
127127
}

0 commit comments

Comments
 (0)