Convert flutter CameraImage to File

CameraImage is normally in YUV 420 format. (Test cameraImage.format.group to confirm.)

This works well with Firebase ML as that's the format that it expects. Useful demo here. However, other recognizers may want other formats (AWS wants a JPEG or PNG, for example).

YUV is tricky to convert as it uses chroma subsampling. Also, for performance, you probably want to be using native code. On Android there's a YUVImage class into which you can pass the planes. It has a method to convert to JPEG. Create a plugin or method channel to pass the plane(s) to a YUVImage, have it save itself to a ByteArrayOutputStream and return the bytes.