title: Flutter pass Uint8List to iOS Objective-c
body: <p>I am trying to pass an image as Uint8List  to native code Android/iOS from Flutter, but getting an error in iOS side. I am modifying a plugin and i never developed in iOS before.
  Here is the Flutter code to capture an image from widget and send the Uint8List to native code.</p>
  
  <pre><code>  Future&lt;void&gt; _capturePng() async {
      RenderRepaintBoundary boundary =
      globalKey.currentContext.findRenderObject();
      ui.Image image = await boundary.toImage(pixelRatio: 1.50);
      ByteData byteData = await image.toByteData(format: ui.ImageByteFormat.png);
      Uint8List pngBytes = byteData.buffer.asUint8List();
  
      printer.printImage(pngBytes);
    }
  </code></pre>
  
  <p>In Android, i am using Kotlin:</p>
  
  <pre><code>private fun printImage(call: MethodCall, result: Result) {
      val image = call.arguments as ByteArray
      val res = mPrinterPlugin.printImage(image)
      result.success(res)
  }
  </code></pre>
  
  <p>In iOS, the plugin is written in Objective-C. i added this check for my image </p>
  
  <pre><code>else if([@"imagePrint" isEqualToString:call.method]){
  
       NSData *imgBytes = call.arguments;
  
       UIImage *label = [UIImage imageWithData:imgBytes];
  
   }
  </code></pre>
  
  <p>I saw that <code>Uint8List</code> is <code>FlutterStandardTypedData typedDataWithBytes</code> in iOS, but when i set the imgBytes type to it i get an error.</p>