App to showcase demo for how to have Clean Architecture in Flutter with Get_It for dependency injection, BLoC for state maintainence and Hive for persisting data into database.
This project is to showcase how we can use Clean Architure in Flutter App. The architecture of the app is as follows -
The existing folder structure of the project is as belows -
Stream<List<FeedModel>> getFeedPostsDatabaseStream() {
if (_feedBox == null) {
_initializeHiveBox();
}
return _feedBox!.watch().map((event) => List<FeedModel>.generate(
_feedBox!.values.length, (index) => _feedBox!.getAt(index)!));
}
Above function will create a Stream to listen for all the changes in the database. This then can be used to update the values automatically on feed_screen.dart
.
flutter pub get
flutter pub run build_runner build --delete-conflicting-outputs
Then you can run the project as usual