How to get Temporary Storage Directory in flutter?

Viewed 2973

I am creating a video app. So it generates thumbnail for every video. I want to store these thumbnail in local Storage of device(only temporary). So I want to get temporary path/Directory in device, where thumbnail will be stored. But I want to delete those thumbnails from Storage when user closes the app.

If you know the answer please answer the Question.

1 Answers

you can use path_provider , link

Directory tempDir = await getTemporaryDirectory();
String tempPath = tempDir.path;

Directory appDocDir = await getApplicationDocumentsDirectory();
String appDocPath = appDocDir.path;
Related