fromUiImage static method
Implementation
static Future<Uint8List> fromUiImage(ui.Image image) async {
final byteData = await image.toByteData(format: ui.ImageByteFormat.png);
if (byteData == null) {
throw Exception('Falha ao converter imagem para bytes');
}
return byteData.buffer.asUint8List();
}