made util function to edit file's caption in public metadata
This commit is contained in:
parent
9a16d0e822
commit
2bea592925
|
@ -7,6 +7,7 @@ const magicKeyVisibility = 'visibility';
|
|||
|
||||
const pubMagicKeyEditedTime = 'editedTime';
|
||||
const pubMagicKeyEditedName = 'editedName';
|
||||
const pubMagicKeyCaption = "caption";
|
||||
|
||||
class MagicMetadata {
|
||||
// 0 -> visible
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue