0
   final image = await screenshotController.capture(delay: const Duration(milliseconds: 10));
    if (image == null) return;
    final tempDir = await getTemporaryDirectory();

    fileImage = null;
    fileImage = await File('${tempDir.path}/example.png').create();
    fileImage?.writeAsBytesSync(image);

I had created File? fileImage before, i ım running a function contains this code then my Image.file() widget is shows cause fileImage is not null any more, but when i am re run this progress i cant override new file and image.file widget still shows first file.

I tried fileImage.delete and then fileImage = null; but stil cant create new file and its fetch the first image file

0 Answers0