A writing prompt application designed to showcase an approach to a "Clean"er architecture in Flutter with Bloc and RxDart, including Unit, Widget and Integration Testing.
This app fetches data from
https://ineedaprompt.com API and displays it on screen. The user can then ask for a new prompt, or see a history of prompts.
The project is structured as follows:
|_data \__local \__remote |_domain \__bloc \__managers \__mappers \__models |_presentation \__styles \__ui \__utils main.dart
The data stores both the API and local database information that will be displayed in the app.
All the API endpoints, models, serialized classes and database helpers should be put here.
This layer connects the data layer to the presentation, preparing the information received from the local database or the server and managing the app state (i.e., if we need to fetch new data, fetch new data)
To communicate with the widgets, we use the BLOC architecture and
Since Flutter does not have a
resources folder as we see in Android, we need to declare each resource on a file. As such, I created the
styles (naming to be changed) folder which include information about colors, strings and dimensions used in the app.
Here we have all the widgets of the app, and their connection to the domain layer via the
Since I chose not to use a dependency injection framework, this is where I create all the classes to be used in the app, inherited by each widget.
Though the app is not fully tested, I strived to show how to:
Write Unit Teststhat test a small module (in this case method) of a class. They tested the network layer and domain layer
Widget Teststhat assure that the
blocis providing the correct information to the widgets
Integration Testthat test a normal app use, expecting a new prompt to be shown on screen.
- [ ] Create more App animations
- [ ] Include more app features, such as share
- [ ] Create more tests