Tomorrow Weather Tomorrow Weather is a Flutter-based weather application that uses the Tomorrow.io weather APIs to provide weather forecasts. This application is compatible with both Android and iOS platforms.
Features Current weather conditions Hourly and weekly forecasts Location-based weather updates Lottie animation
This project relies on several major libraries to function properly:
Dio: A powerful HTTP client for Dart, which supports Interceptors, Global configuration, FormData, Request Cancellation, File downloading, Timeout, etc.Retrofit: A type-safe HTTP client for Dart and Flutter, inspired by Retrofit for Android.RxDart: Provides additional functionality on top of the Dart Streams API for asynchronous programming.Easy Localization: Simplifies the internationalization process in Flutter.Geocoding: Provides geocoding and reverse geocoding of addresses.Permission Handler: A permissions plugin for Flutter which can manage app permissions.Flutter ScreenUtil: A Flutter plugin for adapting screen and font size, allowing your UI to display properly on different screen sizes.Geolocator: A Flutter geolocation plugin which provides easy access to platform-specific location services.Fluttertoast: A plugin to show short message notifications to the user.Dartz: A library for functional programming in Dart.Flutter Bloc: A predictable state management library that helps implement the BLoC design pattern.Equatable: A Dart package that helps to implement value-based equality without needing to explicitly override == and hashCode.Get It: A simple service locator for managing state and dependencies.
This project follows the principles of Clean Architecture, which is an architectural approach that separates the software into concentric layers with a strong emphasis on separation of concerns and scalability. The main components of this architecture in the project are:
Entities: These are the business objects of the application.Use Cases: These are the business rules of the application. Each use case is a set of actions that can be executed.Repositories: These are interfaces that represent the data layer and are implemented in the data layer.Data Sources: These are the actual data providers, such as network requests, database access, etc.Presentation Layer (Bloc): This is where the UI components and user interactions are handled.
The Clean Architecture allows the separation of code in a way that makes it easier to test and maintain. It also ensures that the application is not dependent on any external agency.
To run this project, you need to have Flutter and Dart installed on your system. If you haven't installed them yet, you can follow the instructions on the Flutter website.
Once you have Flutter and Dart set up, you can run the project using the following steps:
-
Clone the repository: Use the command
git clone https://github.com/vancityAyush/tomorrow_weather.gitto clone the repository to your local machine. -
Navigate to the project directory: Use the command
cd tomorrow_weatherto navigate to the project directory in your terminal. -
Fetch the project dependencies: Run
flutter pub getto fetch the project dependencies. -
Check for any dependency issues: Run
flutter doctorto check for any issues with the project dependencies. -
Start your emulator or connect your device: You can start your emulator through your IDE or from the command line with
flutter emulators --launch <emulator_id>. If you want to run the app on your physical device, connect it to your computer and ensure USB debugging is enabled. -
Run the application: Run
flutter runto start the application. If you have multiple devices connected, useflutter run -d <device_id>to specify the device the app should run on. -
Build the application (Optional): If you want to build a release version of your app, you can run
flutter build apkfor Android orflutter build iosfor iOS.
Please note that the application uses the Tomorrow.io API for fetching weather data, so you need to have a valid API key. You can get this key by creating an account on the Tomorrow.io website. Once you have the key, replace the kApiKey constant in the lib/core/utils/constants.dart file with your API key.
Before you can run the application, you need to configure the API key.
- Open the file lib/core/utils/constants.dart.
- Locate the
kApiKeyconstant. - Replace the
kApiKeyconstant with your Tomorrow.io API key.
Please ensure that you do not commit your API key to a public repository.
This project uses build_runner and easy_localization for code generation. To generate the necessary code, run the following commands:
- For
build_runner, run:flutter pub run build_runner watch --delete-conflicting-outputs
- For
build_runner, run:flutter pub run build_runner watch --delete-conflicting-outputs
- For
easy_localization, run:flutter pub run easy_localization:generate --source-dir ./assets/locales -f keys -O lib/gen -o locale_keys.g.dart
If you encounter an issue where the application is making too many API calls to Tomorrow.io, this could be due to hitting the rate limit of your API key.
The solution to this issue is to create a new API key from the Tomorrow.io dashboard. Here are the steps to do so:
- Log in to your account on the Tomorrow.io website.
- Navigate to the API section.
- Click on "Create a new API key".
- Once the new API key is generated, replace the old API key in the lib/core/utils/constants.dart file with the new one.
Remember to manage your API calls wisely to avoid hitting the rate limit frequently.
This project was created by vancityAyush. I am a passionate developer with experience in Kotlin, Java, Dart, and Gradle. I enjoy working on projects that involve complex architectures and innovative solutions. Feel free to reach out to me for any questions, suggestions, or collaboration opportunities.
For any inquiries, you can reach me at:
- Email: eliasakeleven@gmail.com
- Phone: +919060842578
- LinkedIn: Elias AK
- GitHub: vancityAyush

