safeInvoke static method
- MethodChannel channel,
- String methodName
Implementation
static Future<Result<Null, String>> safeInvoke(
MethodChannel channel, String methodName) async {
try {
await channel.invokeMethod<bool>(methodName);
} on PlatformException catch (e) {
return Result<Null, String>.bad("safeInvokeBool failed: ${e.message}");
}
return Result<Null, String>.good(null, "Invoked");
}