Skip to main content

ConnectivityService class

This class provides services related to network connectivity monitoring and handling.

It includes methods for:

  • Initializing the network service - initConnectivity
  • Monitoring connectivity changes - enableSubscription
  • Handling online and offline states - handleOnline, handleOffline
  • Checking reachability of a given URI - isReachable
  • Handling the device's connectivity status - handleConnection
  • Checking if the device has any type of network connection - hasConnection

Constructors

[ConnectivityService][([[Connectivity] connectivityInstance])]

:

Properties

[connectionStatusController] [↔ StreamController[<[List[<[ConnectivityResult]>]]>]] : Stream controller for network status changes. ::: features getter/setter pair :::

[connectionStream] [→ Stream[<[List[<[ConnectivityResult]>]]>]] : Getter for the stream of connection status changes. ::: features no setter :::

[connectivityInstance] [↔ Connectivity] : dependency injection connectivity. ::: features latefinal :::

[hashCode] [→ int] : The hash code for this object. ::: features no setterinherited :::

[runtimeType] [→ Type] : A representation of the runtime type of the object. ::: features no setterinherited :::

Methods

[enableSubscription][ [→ Future<[void>]] ] : This function enables the subscription to connectivity changes.

[getConnectionType][ [→ Future[<[List[<[ConnectivityResult]>]]>]] ] : Checks the current internet connectivity status of the device.

[hasConnection][ [→ Future[<[bool]>]] ] : This function checks if the device currently has any type of network connection.

[initConnectivity][ [→ Future<[void>]] ] : This function initializes connectivity monitoring.

[isReachable][ [→ Future[<[bool]>]] ] : This function checks if a given URI is reachable within a specified timeout period.

[noSuchMethod][([[Invocation] invocation]) → dynamic ] : Invoked when a nonexistent method or property is accessed. ::: features inherited :::

[toString][ [→ String] ] : A string representation of this object. ::: features inherited :::

Operators

[operator ==][([[Object] other]) [→ bool] ] : The equality operator. ::: features inherited :::

  1. talawa
  2. connectivity_service
  3. ConnectivityService class
connectivity_service library