nativeMethodCallHandler method

Future nativeMethodCallHandler(
  1. MethodCall methodCall
)

Implementation

Future<dynamic> nativeMethodCallHandler(MethodCall methodCall) async {
  if (methodCall.method == "printerFound") {
    onPrinterFound!(
        methodCall.arguments["Name"],
        methodCall.arguments["Address"],
        methodCall.arguments["IsWifi"].toString() == "true" ? true : false);
  } else if (methodCall.method == "changePrinterStatus") {
    onChangePrinterStatus!(
        methodCall.arguments["Status"], methodCall.arguments["Color"]);
  } else if (methodCall.method == "onPrinterDiscoveryDone") {
    onPrinterDiscoveryDone!();
  } else if (methodCall.method == "onDiscoveryError") {
    onDiscoveryError!(methodCall.arguments["ErrorCode"]
        , methodCall.arguments["ErrorText"]);
  }
  return null;
}