A Flutter application that displays country data with offline support using Hive, API integration with Dio, and state management with Cubit (Bloc). Users can search for countries, view details, and save favorites.
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
- List all countries with flag, population, and name
- Search countries by name with real-time filtering
- View detailed information for each country
- Favorite countries locally with Hive persistence
- Offline support using cached data in Hive
- Light/Dark mode toggle
- Cached network images for offline viewing
- Flutter: 3.38.0
- Dart: 3.10.0
- Java: JDK 25
- Clone the repository
git clone https://github.com/ad-ng/countries_app.git
cd countries_app- Install dependencies
flutter pub getCreate a .env file in the root of the project:
BASEURL='https://restcountries.com'
KEYSTORE_PATH=
KEYSTORE_PASSWORD=
KEY_ALIAS=
KEY_PASSWORD=- BASEURL → The base URL for the REST Countries API
- Keystore variables → Needed for building a signed Android release APK
This project follows Clean Architecture principles with a clear separation of concerns while leveraging modern Flutter technologies.
-
Presentation Layer
- Handles UI and state management.
- Technologies: Flutter Widgets, Cubit/Bloc, GoRouter, Material 3, light/dark mode toggle.
-
Domain Layer
- Encapsulates business logic and core entities.
- Technologies: Plain Dart entities (
CountrySummary,CountryDetails), use cases (GetAllCountries,SearchCountriesByName,GetOneCountry).
-
Data Layer
- Responsible for fetching and caching data.
- Remote:
CountryApiServiceusing Dio with interceptors and custom error handling. - Local:
CountryHiveServiceusing Hive for offline persistence. - Repository: Combines remote and local sources.
-
Core / Shared Layer
- Provides shared utilities and app-wide services.
- Technologies:
DioService,ThemeCubit, error handling models, utility functions.
-
Caching & Offline Support
- Technologies: Hive for local storage,
cached_network_imagefor offline flag caching.
- Technologies: Hive for local storage,







