screenShot method Null safety

dynamic screenShot()

Implementation

screenShot() async{
    RenderRepaintBoundary? boundary = globalKey.currentContext?.findRenderObject() as RenderRepaintBoundary;
    if(boundary == null) return;

    ui.Image image = await boundary.toImage();
    ByteData? byteData = await image.toByteData(format: ui.ImageByteFormat.png);

    print('IMAGE: ${byteData?.buffer.asUint8List()}');
    /*

    var filePath = await ImagePickerSaver.saveFile(
        fileData:byteData.buffer.asUint8List() );
    print(filePath);
    */

}