made util function to edit file's caption in public metadata

This commit is contained in:
ashilkn 2022-11-04 15:40:11 +05:30
parent 9a16d0e822
commit 2bea592925
2 changed files with 16 additions and 1 deletions

View file

@ -7,6 +7,7 @@ const magicKeyVisibility = 'visibility';
const pubMagicKeyEditedTime = 'editedTime';
const pubMagicKeyEditedName = 'editedName';
const pubMagicKeyCaption = "caption";
class MagicMetadata {
// 0 -> visible

View file

@ -120,7 +120,21 @@ Future<bool> editFilename(
);
return true;
} catch (e) {
showToast(context, 'something went wrong');
showToast(context, 'Something went wrong');
return false;
}
}
Future<bool> editFileCaption(
BuildContext context,
File file,
String caption,
) async {
try {
await _updatePublicMetadata(context, [file], pubMagicKeyCaption, caption);
return true;
} catch (e) {
showToast(context, "Something went wrong");
return false;
}
}