handleMethodCall method

Future handleMethodCall(
  1. MethodCall call
)

Implementation

Future<dynamic> handleMethodCall(MethodCall call) async {
  if ("init" == call.method) {
    js.context["TInstall"].callMethod("init", [call.arguments["appKey"]]);
  } else if ("registered" == call.method) {
    js.context["TInstall"].callMethod("registered");
  } else if ("getInstall" == call.method) {
    Completer completer = Completer();
    js.context["TInstall"].callMethod("getInstall", [
      (code) {
        completer.complete(code);
      }
    ]);
    return completer.future;
  }
  return Future.value("");
}