NearbyAndroidService class

Android implementation for NearbyService.

Uses NearbyServiceAndroidPlatform to perform actions. Connects to the device via a socket from NearbySocketService.

Inheritance
Available Extensions

Constructors

NearbyAndroidService()

Properties

android NearbyAndroidService?
Returns NearbyService cast as NearbyAndroidService if the current platform is Android. Otherwise, returns null.
latefinalinherited
communicationChannelState ValueListenable<CommunicationChannelState>
A value to determine the communication channel's status.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
ios NearbyIOSService?
Returns NearbyService cast as NearbyIOSService if the current platform is IOS. Otherwise, returns null.
latefinalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

cancelLastConnectionProcess() Future<bool>
On NearbyServiceBusyException you can check for running jobs (if any of devices has NearbyDeviceStatus.connecting).
checkWifiService() Future<bool>
Checks if Wi-fi is enabled. Wi-fi must be enabled for Android to use the plugin!
connect(NearbyDevice device) Future<bool>
Connects to the device on the Wifi Direct network.
override
disconnect([NearbyDevice? device]) Future<bool>
Disconnects from the device on the Wifi Direct network.
override
discover() Future<bool>
Starts discovery of the Wifi Direct network.
override
endCommunicationChannel() FutureOr<bool>
Ends the socket service to stop transferring data.
override
getConnectedDeviceStream(NearbyDevice device) Stream<NearbyDevice?>
Returns the constantly updating NearbyDevice you are currently connected to. If it returns null, then there is no connection at the moment.
inherited
getConnectionInfo() Future<NearbyConnectionAndroidInfo?>
Returns NearbyConnectionAndroidInfo - information about the connection information.
getConnectionInfoStream() Stream<NearbyConnectionAndroidInfo?>
Streams NearbyConnectionAndroidInfo - information about the connection information.
getCurrentDeviceInfo() Future<NearbyDeviceInfo?>
Getting info about the current device in P2P scope.
inherited
getPeers() Future<List<NearbyDevice>>
A single retrieval of the current list of devices in a P2P network.
inherited
getPeersStream() Stream<List<NearbyDevice>>
Returns a constantly updating list of NearbyDevice that the platform-specific service has found at each point in time.
inherited
getPlatformModel() Future<String?>
Gets model of current device.
inherited
getPlatformVersion() Future<String?>
Gets version of current platform.
inherited
initialize({NearbyInitializeData data = const NearbyInitializeData()}) Future<bool>
Initializes Android WifiP2PManager
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
openServicesSettings() Future<void>
Since Wi-fi must be enabled to use the plugin in Android, openServicesSettings can be used to redirect the user to the Wi-fi service settings on Android.
inherited
requestPermissions() Future<bool>
Request permissions at the platform level. This is required for Android for using the plugin!
send(OutgoingNearbyMessage<NearbyMessageContent> message) FutureOr<bool>
Adds OutgoingNearbyMessage to the socket.
override
startCommunicationChannel(NearbyCommunicationChannelData data) FutureOr<bool>
Starts a socket service to transfer data. Uses device with NearbyCommunicationChannelData.connectedDeviceId.
override
stopDiscovery() Future<bool>
Stops discovery of the Wifi Direct network.
override
toString() String
A string representation of this object.
inherited

Operators

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