onSelectedPhoto method

void onSelectedPhoto(
  1. List<XFile> files
)

Implementation

void onSelectedPhoto(List<XFile> files) async {
  try {
    if (files.firstOrNull != null) {
      Get.dialog(const LoadingDialog());
      _uploadProfile(await files.firstOrNull!.readAsBytes());
    }
  } catch (e) {
    Get.back();
    log('Error picking photo : ${e.toString()}');
    DefaultSnackbar.show(
        "Error", "Failed to change photo. Please try again.");
  }
}