error fixes

multipeer_ios
Prerak Mann 5 years ago
parent c118ce5096
commit 9ff7aa546f

@ -201,10 +201,13 @@ class _MyBodyState extends State<Body> {
),
RaisedButton(
child: Text("Reject Connection"),
onPressed: () {
onPressed: () async {
Navigator.pop(context);
Nearby().rejectConnection(id);
try {
await Nearby().rejectConnection(id);
} catch (e) {
showSnackbar(e);
}
},
),
],

@ -230,7 +230,7 @@ class Nearby {
Future<bool> rejectConnection(String endpointId) async {
return await _channel.invokeMethod(
'acceptConnection',
'rejectConnection',
<String, dynamic>{
'endpointId': endpointId,
},
@ -248,18 +248,6 @@ class Nearby {
}
}
abstract class ConnectionLifecycleCallback {
void onConnectionInitiated(String endpointId, ConnectionInfo connectionInfo);
void onConnectionResult(String endpointId, Status status);
void onDisconnected(String endpointId);
}
abstract class EndpointDiscoveryCallback {
void onEndpointFound(
String endpointId, String endpointName, String serviceId);
void onEndpointLost(String endpointId);
}
class ConnectionInfo {
String endpointName, authenticationToken;
bool isIncomingConnection;
@ -267,3 +255,6 @@ class ConnectionInfo {
ConnectionInfo(
this.endpointName, this.authenticationToken, this.isIncomingConnection);
}
//TODO remove errors on failure for smooth experience
//TODO expose only relevant parts as library
//TODO publish to pub.dartlang

Loading…
Cancel
Save