stopRecord static method
Implementation
static void stopRecord(
{VoidCallback? onRecordStart,
void Function(String path)? onRecodeDone}) async {
_channel.invokeMethod("stopRecord");
_channel.setMethodCallHandler((MethodCall call) async {
var method = call.method;
var back = call.arguments;
print('native call:$method -> $back');
switch (method) {
case "onRecordStart":
onRecordStart?.call();
break;
case "onRecodeDone":
if(Platform.isIOS){
String path = back["path"];
onRecodeDone?.call(path);
}else{
onRecodeDone?.call(back);
}
break;
default:
throw UnsupportedError("Unrecognized JSON message");
}
});
}