Example project to explore the BLoC architecture and learn Flutter/Dart
The aim of this project is to learn Flutter and BLoC architecture, as well as keeping things simple, secure while using good software development practices.
If you want to clone this project and try it out, you should follow the next steps:
Create an assets
folder juts in the root of this project, and inside it, you would need to store
the secrets.json
file.
The IMDB API Key could be obtained from this link
secrets.json:
{
"api_key": "YOUR_API_KEY"
}
If the files inside models/
folder are changed, we would need to run:
$ flutter packages pub run build_runner watch
In order to automatically generate the .g files, that would contain the necessary code for JSON parsing given a model.
- BLoC (Business Logic Component) architecture
- JSON Serialization
- Load a list retrieved from a web service
- Hide Secret API Key
- Business models & Data models
- Mapper between models
- Open detail when clicking on an item
- Unit tests
- Widget tests
- Code coverage report
- Check that code style is following most of Dart/Flutter specs
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
rxdart: ^0.18.0
http: ^0.12.0+1
json_annotation: ^2.0.0
dev_dependencies:
flutter_test:
sdk: flutter
build_runner: ^1.0.0
json_serializable: ^2.0.0
In order to work with this project I will be following and merging these different articles: