A simple Flutter application that allows users to search for images on Flickr using search bar or predefined keywords
- Flutter
- Dart
- dio A powerful Http client for Dart
- retrofit a type conversion dio client generator using source_gen and inspired by Retrofit2 (Android and Java)
- rxdart an implementation of the popular reactiveX api for asynchronous programming
- get_it simple direct Service Locator that allows to decouple the interface from a concrete implementation and to access the concrete implementation from everywhere
This project follows BLoC Pattern and Clean Architecture
Flutter UI widgets belong here. View communicates with BLoC, subscribing to ViewState. Each Widget has a ViewState attached that provides the data required by the view to make state transitions.
This module provides the logic of the UI, by providing subscribing components to the widgets to react to. The BLoC changes the ViewState based on the use case responses.
Contain use cases of the application. They provide the application specific business rules and are are responsible of accessing data from different repositories, combine and transform them, to provide single use case business rule.
The Data layer is our access point to external data layers and is used to fetch data from multiple sources (network, cache). It contains implementations of Repositories, which request data from necessary RemoteDataSources and CacheDataSources to feed the use case and make communication between the 2 types of data sources.
The Remote layer handles all communications with remote sources such as API calls using a Retrofit definition. A RemoteImpl class implements a Remote interface from the Data layer and uses a Service to retrieve data from the API.
The Cache layer handles all communication with the local database.
flutter test
- Retrieve a flickr api key by following this instruction
- In the root of the repository, create an assets directory if it is missing
- Inside assets, create a file called
secret.json
with the following content
{"flickr_api_key": "<YOUR_FLICKR_API_KEY>"}
- Connect a device or an emulator
- Build
flutter run
Github Actions will run tests and build debug application (iOS, Android) on every pull request and merge event. Test coverage is reported at CodeCov