added stop smartconfig

This commit is contained in:
Niklas 2019-01-27 21:37:06 +01:00
parent 0b035dc916
commit 97853d525e

View File

@ -7,7 +7,25 @@ import 'dart:io' show Platform;
// for iOS https://github.com/lou-lan/SmartConfig
class FlutterSmartconfig {
static const platform = const MethodChannel("plugins.flutter.io/flutter_smartconfig");
static const platform =
const MethodChannel("plugins.flutter.io/flutter_smartconfig");
static Future<void> stopConfigure() async {
if (Platform.isAndroid) {
try {
await platform.invokeMethod('stopSmartConfig');
} on PlatformException catch (e) {
return Future<Map<String, String>>(() {
throw new PlatformException(
code: "Failed to get connected WiFi name: '${e.message}'.");
});
}
} else {
return Future<Map<String, String>>(() {
throw new PlatformException(code: "only Android is supported");
});
}
}
static Future<dynamic> configureEsp(
{String ssid, String bssid, String password}) async {