Can now Establish connection

This commit is contained in:
Prerak Mann
2019-05-11 23:42:35 +05:30
parent 6234775c1b
commit a5a4221188
4 changed files with 11 additions and 351 deletions

View File

@@ -28,7 +28,8 @@ class Nearby {
Nearby._() {
_channel.setMethodCallHandler((handler) {
Map<String, dynamic> args = handler.arguments;
Map<dynamic, dynamic> args = handler.arguments;
print("=====================");
print(handler.method);
args.forEach((s, d) {
@@ -89,10 +90,10 @@ class Nearby {
return null;
case "dis.onEndpointFound":
print("in switch");
String endpointId = args['endpointId'];
String endpointName = args['endpointName'];
String serviceId = args['serviceId'];
_onEndpointFound?.call(endpointId, endpointName, serviceId);
return null;
@@ -158,6 +159,8 @@ class Nearby {
@required OnEndpointLost onEndpointLost,
}) async {
assert(userNickName != null && strategy != null);
this._onEndpointFound = onEndpointFound;
this._onEndpointLost = onEndpointLost;
return await _channel.invokeMethod('startDiscovery', <String, dynamic>{
'userNickName': userNickName,