nativeMethodCallHandler method
Implementation
Future<dynamic> nativeMethodCallHandler(MethodCall methodCall) async {
print('Native call!');
switch (methodCall.method) {
case "success":
if (this.onSuccess != null) {
this.onSuccess!(methodCall.arguments);
}
break;
case "error":
if (this.onError != null) {
this.onError!(methodCall.arguments);
}
break;
case "cancel":
if (this.onCancel != null) {
this.onCancel!(methodCall.arguments);
}
break;
case "failure":
if (this.onFailure != null) {
this.onFailure!(methodCall.arguments);
}
break;
case "hash":
if (this.hashGenerate != null) {
return await this.hashGenerate!(methodCall.arguments);
} else {
return null;
}
break;
default:
return "Nothing";
break;
}
return true;
}