A Flutter application for displaying the current weather in a selected city.
The project uses the OpenWeather API and GeoNames for geocoding and autocomplete, and is built following Clean Architecture (Layer-first) principles, with the presentation layer divided into feature-based modules.
- View current weather for a selected city
- Geocoding (convert city name to coordinates) using GeoNames
- City name autocomplete using GeoNames
- Display:
- temperature
- weather conditions
- humidity
- wind speed
- Loading and error state handling
- Easily extensible for multi-day weather forecasts
The project is implemented using Clean Architecture (Layer-first):
- Layer-first: code is organized by layers, not by features
- Feature-based presentation: each feature is isolated within the presentation layer
- Dependency Rule:
presentation -> domain <- data
- The domain layer is independent of Flutter and external libraries
- Communication between layers is done through abstractions (interfaces)
The application integrates with the following external services:
- OpenWeather API
- Used to fetch current weather data
- Documentation: https://openweathermap.org/api
- GeoNames API
- Used for geocoding and autocomplete
- Documentation: https://www.geonames.org/export/web-services.html
To run the project, API keys are required.
They are provided via dart-define.
Example dart_define.json file:
{
"OPENWEATHER_KEY": "your_api_key_here",
"GEONAMES_USERNAME": "username"
}Also you need to run this commands before start app:
flutter pub global activate dart_define
flutter pub get
flutter pub run easy_localization:generate --source-dir lib/core/localization --output-dir lib/core/localization/generated
flutter pub run easy_localization:generate --source-dir lib/core/localization --output-dir lib/core/localization/generated -f keys -o locale_keys.g.dart
dart run build_runner build
flutter run --dart-define-from-file=dart_define.json