readImageData function

Future<List<int>> readImageData(
  1. GlobalKey<SfCartesianChartState>? globalKey
)

Read image data

Implementation

Future<List<int>> readImageData(
    GlobalKey<SfCartesianChartState>? globalKey) async {
  final dart_ui.Image? data =
      await globalKey!.currentState!.toImage(pixelRatio: 3.0);
  final ByteData? bytes =
      await data?.toByteData(format: dart_ui.ImageByteFormat.png);
  return bytes!.buffer.asUint8List(bytes.offsetInBytes, bytes.lengthInBytes);
}