invoke static method
Implementation
static Future<dynamic> invoke(MethodChannel methodChannel, methodName, [dynamic methodArgs]) async {
try {
if (methodArgs is Map) {
var args = methodArgs;
final result = await methodChannel.invokeMethod(methodName, args);
return result;
} else if (methodArgs == null) {
final result = await methodChannel.invokeMethod(methodName);
return result;
}
} on PlatformException catch (e) {
debugPrint('$e');
return null;
}
}