pick function

Future pick(
  1. dynamic lang,
  2. dynamic pinAttachmentType
)

Implementation

Future<FilePickerResult?> pick(
    L10n lang, AttachmentType pinAttachmentType,) async {
  if (pinAttachmentType == AttachmentType.image) {
    return await pickImage(lang: lang);
  }
  return await FilePicker.platform.pickFiles(
    type: switch (pinAttachmentType) {
      AttachmentType.video => FileType.video,
      AttachmentType.audio => FileType.audio,
      _ => FileType.any,
    },
  );
}