mirror of
https://github.com/hackku21/nearby_connections.git
synced 2026-03-02 03:49:22 +00:00
updated dartdocs, Published 1.0.2+1
This commit is contained in:
@@ -176,7 +176,7 @@ class Nearby {
|
||||
'askExternalStoragePermission',
|
||||
);
|
||||
|
||||
/// Start Advertising
|
||||
/// Start Advertising, Discoverers would be able to discover this advertiser.
|
||||
///
|
||||
/// [userNickName] and [strategy] should not be null
|
||||
Future<bool> startAdvertising(
|
||||
@@ -208,7 +208,7 @@ class Nearby {
|
||||
await _channel.invokeMethod('stopAdvertising');
|
||||
}
|
||||
|
||||
/// Start Discovery
|
||||
/// Start Discovery, You will now be able to discover the advertisers now.
|
||||
///
|
||||
/// [userNickName] and [strategy] should not be null
|
||||
Future<bool> startDiscovery(
|
||||
@@ -337,12 +337,18 @@ class Nearby {
|
||||
|
||||
/// Send bytes [Uint8List] payload to endpoint
|
||||
///
|
||||
/// Convert String to Uint8List as follows
|
||||
/// Convert String to Uint8List as follows -
|
||||
///
|
||||
/// ```dart
|
||||
/// String a = "hello";
|
||||
/// Uint8List bytes = Uint8List.fromList(a.codeUnits);
|
||||
///
|
||||
/// ```
|
||||
/// Convert bytes [Uint8List] to String as follows -
|
||||
/// ```dart
|
||||
/// String str = String.fromCharCodes(payload.bytes);
|
||||
/// ```
|
||||
///
|
||||
Future<void> sendBytesPayload(String endpointId, Uint8List bytes) async {
|
||||
assert(endpointId != null);
|
||||
|
||||
@@ -374,6 +380,7 @@ class Nearby {
|
||||
);
|
||||
}
|
||||
|
||||
/// Use it to cancel/stop a payload transfer
|
||||
Future<void> cancelPayload(int payloadId) async {
|
||||
assert(payloadId != null);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user