NetworkConnectivityProvider

Abstract base class for implementing platform-specific network connectivity providers.

This class provides a common pattern for implementing network connectivity monitoring across different platforms by managing the lifecycle of a platform-specific receiver that monitors network state changes.

Inheritors

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
interface Receiver

Interface for platform-specific network connectivity receivers.

Functions

Link copied to clipboard
open override fun addListener(listener: Listener<NetworkConnectivityEvent>)

Registers a listener to receive events.

Link copied to clipboard
fun <E> Listenable<E>.asFlow(): Flow<E>

Converts this Listenable into a Flow that emits events.

Link copied to clipboard

Checks if there are any registered listeners.

Link copied to clipboard
open override fun notify(event: NetworkConnectivityEvent)

Notifies all registered listeners about an event.

Link copied to clipboard
open override fun removeListener(listener: Listener<NetworkConnectivityEvent>)

Unregisters a listener from receiving events.