https://github.com/mrusamamuzaffar/flutter_bloc_implementation
A beautiful bloc implementation in Flutter
https://github.com/mrusamamuzaffar/flutter_bloc_implementation
bloc dart dart-library dart-package dart2 dartlang flutter flutter-app flutter-apps flutter-bloc flutter-bloc-pattern flutter-bloc-pattern-rxdart flutter-bloc-rxdart flutter-boilerplate flutter-clean-architecture flutter-developer flutter-examples state state-management
Last synced: 4 months ago
JSON representation
A beautiful bloc implementation in Flutter
- Host: GitHub
- URL: https://github.com/mrusamamuzaffar/flutter_bloc_implementation
- Owner: mrusamamuzaffar
- Created: 2023-01-17T08:37:58.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-01-17T08:38:10.000Z (about 3 years ago)
- Last Synced: 2025-04-05T17:43:11.987Z (10 months ago)
- Topics: bloc, dart, dart-library, dart-package, dart2, dartlang, flutter, flutter-app, flutter-apps, flutter-bloc, flutter-bloc-pattern, flutter-bloc-pattern-rxdart, flutter-bloc-rxdart, flutter-boilerplate, flutter-clean-architecture, flutter-developer, flutter-examples, state, state-management
- Language: Dart
- Homepage:
- Size: 275 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Weather App
### Implementation
It includes 4 layers:
1. Data layer (data provider)
2. Repository layer
3. Business layer (cubit/state)
3. Presentation layer (front-end/UI)
And you start coding them respectively. Overall concept for this architecture will be:
**Your Data Layer must be hidden/abstracted from your business/presentation layer, so the point of interaction will be the repository layer**
### Terminologies
#### Barrel
- Just a file that exports other files to clean-up imports
### Extensions
#### Bloc
- VS Code extension: https://marketplace.visualstudio.com/items?itemName=FelixAngelov.bloc
- Dart Data Class Generator: https://marketplace.visualstudio.com/items?itemName=hzgood.dart-data-class-generator
### Project structure
### Business and Presentation layer
```
lib
- extensions
- ...
- screens/
- weather/
- cubits (Business layer)
- weather_cubit.dart
- weather_state.dart
- models
- models.dart (Barrel)
- views (Presentation layer)
- weather_view.dart (Entry point of UI)
- widgets/
- error.dart
- loading.dart
- success.dart
- widgets.dart (Barrel)
```
### Data and Repository layers
```
packages
- weather_data_provider/ (Data layer - Abstracted/Hidden)
- lib/
- src/
- models/
- models.dart (barrel)
- location.dart
- weather.dart
- weather_data_provider.dart (data provider implementation)
- weather_data_provider (Barrel)
- weather_repository (Repository layer)
- lib/
- src/
- models
- models.dart (barrel)
- weather.dart
- weather_repository.dart (repository implementation)
- weather_repository.dart (barrel)
```