AirpassClient class

The primary API for the Flutter UI to interact with the Airpass mesh.

Obtain via GetIt:

final client = getIt<AirpassClient>();

Constructors

AirpassClient({required AirpassDatabase db, required EndpointCodec codec, required MediaStorageService mediaStorage, required String localNodeId, required NodeRole localRole})

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

createAndJoinGroup(String groupName) Future<void>
Creates a new group and immediately subscribes to it.
getMediaPath(String messageId) Future<String?>
Returns the local file path for a media message, or null if the binary hasn't been downloaded yet.
listenForMessages({required String targetId, bool isGroup = true}) Stream<List<Message>>
Returns a reactive stream of messages matching targetId.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
requestMediaDownload(String messageId) Future<void>
Manually requests download of a media file.
sendMediaMessage({required String filePath, required MediaType mediaType, required String targetId, String? caption}) Future<String>
Sends a media message (image, video, audio, or file).
sendMessage({required String payload, required String targetId}) Future<String>
Saves a new outgoing message to the local database as PENDING.
subscribeToGroup(String groupName) Future<void>
Subscribes the local node to a discovered group.
toString() String
A string representation of this object.
inherited
unsubscribeFromGroup(String groupName) Future<void>
Unsubscribes from a group and re-advertises without it.
updateBatteryLevel(int? batteryLevel) → void
Updates the local node's battery level in the background sync engine. The new level will be included in the next sync payload.
updateInternetAccess(bool hasInternetAccess) → void
Updates the local node's internet access status in the background sync engine. The new status will be included in the next sync payload.
watchDiscoveredGroups() Stream<List<Group>>
Returns a reactive stream of all discovered groups.

Operators

operator ==(Object other) bool
The equality operator.
inherited