AdministrativeUnitsRepository

class AdministrativeUnitsRepository @Inject constructor(administrativeUnitDataSource: AdministrativeUnitDataSource, imageDataSource: ImageDataSource)

The repository that exposes and manipulates the administrative units' screen flows. This repository manages the data flow related to administrative units displayed on the screen and provides methods for manipulating and accessing this data.

Constructors

Link copied to clipboard
@Inject
constructor(administrativeUnitDataSource: AdministrativeUnitDataSource, imageDataSource: ImageDataSource)

Properties

Link copied to clipboard

The list of all possible administrative levels used in the dropdown in the administrative unit screen

Link copied to clipboard

A flow representing the list of administrative units. It will be updated with the most recent administrative units and will resend if the user changes the current administrative unit.

Link copied to clipboard

The current administrative level flow will update when the use choose a different level on the dropdown in the administrative unit screen

Functions

Link copied to clipboard

When the user select a different administrative level using the dropdown this method search using the index and update the current administrative level. This triggers again the list of administrative units flow updating the view.

Link copied to clipboard
suspend fun removeAllImages()

Remove all images from data source.

Link copied to clipboard

When the user select an administrative unit in the grid this method will update the data source with the index of the administrative unit selected.