Disabled asset change notifying only after getFile() is done on downloading a file
This commit is contained in:
parent
39bfd985bb
commit
8fd62127f8
1 changed files with 3 additions and 3 deletions
|
@ -411,15 +411,15 @@ class FadingAppBarState extends State<FadingAppBar> {
|
|||
Future<void> _download(File file) async {
|
||||
final dialog = createProgressDialog(context, "Downloading...");
|
||||
await dialog.show();
|
||||
//Disabling notifications for assets changing to insert the file into
|
||||
//files db before triggering a sync.
|
||||
PhotoManager.stopChangeNotify();
|
||||
try {
|
||||
final FileType type = file.fileType;
|
||||
final bool downloadLivePhotoOnDroid =
|
||||
type == FileType.livePhoto && Platform.isAndroid;
|
||||
AssetEntity? savedAsset;
|
||||
final io.File? fileToSave = await getFile(file);
|
||||
//Disabling notifications for assets changing to insert the file into
|
||||
//files db before triggering a sync.
|
||||
PhotoManager.stopChangeNotify();
|
||||
if (type == FileType.image) {
|
||||
savedAsset = await PhotoManager.editor
|
||||
.saveImageWithPath(fileToSave!.path, title: file.title!);
|
||||
|
|
Loading…
Add table
Reference in a new issue