App that show git commit history. This app is built with Flutter.
For this poject Clean Architecture was choosen. Beacause keep the code clean and tested are the two most important development practices. Even state management patterns like BLoC are not sufficient in themselves to allow for easily extendable codebase. If you want to learn more about this, you can read my article here.
For this we should all strive to separate code into independent layers and depend on abstractions instead of concrete implementations.
Every "Date module" of the app, like home, is divided into 3 layers - presentation, domain and infrastructure. This app have only one data module, Catalog.
The presentation layer("Features") contain Pages, Widgets and Bloc.
The data layer contain Entities, Repositories and Usecases. It should be totally independent of every other layer. The data layer consists of a Repository implementation and data sources - this is usually for getting remote (API) data.
These instructions will allow you to obtain a copy of the application for testing.
To build and run this project:
- Get Flutter here if you don't already have it
- Clone this repository
git clone https://github.com/alvaroarmijos/ftf_github_api
cd
into the repo foldercd ftf_github_api
flutter pub get
- Replace the token inside lib/src/packages/data/catalog/src/infrastructure/api_client.dart
- run
flutter run
to run the app.
This sample requires Flutter 3.16
The test coverage of this application is 72%.
All you have to do is to run these three commands:
# Generate `coverage/lcov.info` file
flutter test --coverage
#Remove DI files from coverage
lcov --remove coverage/lcov.info "**/di/" -o coverage/lcov.info
# Generate HTML report
# Note: on macOS you need to have lcov installed on your system (`brew install lcov`) to use this:
genhtml coverage/lcov.info -o coverage/html
# Open the report
open coverage/html/index.html
You need these packages for the application to work