AdministrativeUnitsViewModel

class AdministrativeUnitsViewModel @Inject constructor(administrativeUnitsRepository: AdministrativeUnitsRepository) : ViewModel

The AdministrativeUnitsViewModel is the point of connection between the Administrative Units screen and its Repository

Constructors

Link copied to clipboard
@Inject
constructor(administrativeUnitsRepository: AdministrativeUnitsRepository)

Properties

Link copied to clipboard

The stream (Flow) of Administrative Levels converted into UI objects

Link copied to clipboard

The stream (Flow) of Administrative Units converted into UI objects

Link copied to clipboard

The stream (Flow) of the current Administrative Level converted into UI object

Functions

Link copied to clipboard
Link copied to clipboard

Delegates the Repository to update the current administrative level to show the new administrative units filtered by the level index provided. It creates a coroutine to do that.

Link copied to clipboard
fun removeAllImages(): Job

Delegates the repository to remove all images. It creates a coroutine to do that.

Link copied to clipboard

Delegates the Repository to update the selected administrative unit in the model based on the provided index. It creates a coroutine to do that.