Connectivity

interface Connectivity

The Connectivity interface provides a way to monitor the network connectivity status.

Types

Link copied to clipboard
sealed interface Status

Represents the connectivity status.

Properties

Link copied to clipboard
Link copied to clipboard
abstract val monitoring: StateFlow<Boolean>

A StateFlow representing whether the connectivity monitoring is active.

Link copied to clipboard
abstract val statusUpdates: SharedFlow<Connectivity.Status>

A SharedFlow representing the current connectivity status.

Functions

Link copied to clipboard
abstract fun start()

Starts monitoring the connectivity status.

Link copied to clipboard
abstract suspend fun status(): Connectivity.Status

Gets the current connectivity status.

Link copied to clipboard
abstract fun stop()

Stops monitoring the connectivity status.