'Flutter_Downloader Package : save file in gallery

I am working in flutter app to download image and video using flutter_downloader its work fine to download video and save it in my app folder , but i want save video in gallery also ,

now this function :

    final taskId = await FlutterDownloader.enqueue(
      url: url,
      fileName: fileName,
      savedDir: appDocDir.path,
      showNotification: true,
      openFileFromNotification: true,
      saveInPublicStorage: true, //Save file in Download Folder not in app folder 
    );  

when add this saveInPublicStorage: true,

its work fine to download file and save it in gallery but file save in

/storage/emulated/0/Download

when delete this saveInPublicStorage: true, it save in my app folder but not save in gallery :

/storage/emulated/0/APP-Folder

how can i save it in my app folder and gallery ?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source