This is a simple Flutter weather application built using the Cubit for state management. The app fetches weather data from an API and displays it in a user-friendly interface. It demonstrates how to structure a Flutter app with Cubit for efficient state management.
- Current Weather: View the current weather details, including temperature, weather conditions, and more.
- Refresh: Pull-to-refresh functionality to update weather data.
- Responsive UI: Responsive design that adapts to various screen sizes.
Flutter 3.16.9 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 41456452f2 (4 days ago) • 2024-01-25 10:06:23 -0800
Engine • revision f40e976bed
Tools • Dart 3.2.6 • DevTools 2.28.5
Dependecies
http: ^1.2.0
bloc: ^8.1.2
flutter_bloc: ^8.1.3
equatable: ^2.0.5
intl: ^0.19.0
-
Clone the repository:
git clone https://github.com/RohanSengupta326/WeatherApp-Bloc
-
Navigate to the project folder:
cd WeatherApp-Bloc
-
run
flutter pub get
-
run the app :
flutter run
The app follows the Cubit pattern for efficient state management. Key components include:
- Cubit: Handles the business logic and emits states in response to events.
- Events: Trigger actions that cause the Cubit to emit new states.
- States: Represent different states of the application (e.g., loading, loaded, error).