SecondViewModel

The MVVM androidx.lifecycle.ViewModel for the second screen in the MVVM with Compose and Navigation demo. Picks up cargo from the com.grarcht.shuttle.framework.Shuttle warehouse and exposes the result as a StateFlow of com.grarcht.shuttle.framework.result.ShuttlePickupCargoResult.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
val pickupCargoState: StateFlow<ShuttlePickupCargoResult>

Functions

Link copied to clipboard
open fun addCloseable(closeable: AutoCloseable)
fun addCloseable(key: String, closeable: AutoCloseable)
Link copied to clipboard
fun currentImageModel(): ImageModel?

Returns the com.grarcht.shuttle.demo.core.image.ImageModel from the last successful pickup, or null if pickup has not completed successfully.

Link copied to clipboard
Link copied to clipboard
fun loadImage(shuttle: Shuttle, cargoId: String)

Initiates cargo pickup from the com.grarcht.shuttle.framework.Shuttle warehouse using cargoId and updates pickupCargoState with the result. The pickup terminates automatically upon a success or error result.