pickProfileImage method

Future<void> pickProfileImage()

Implementation

Future<void> pickProfileImage() async {
  final isGranted = await _permissionService.requestGallery();
  if (!isGranted) {
    Get.snackbar(
      'Permission needed',
      'Please allow gallery access to choose a profile picture.',
      snackPosition: SnackPosition.BOTTOM,
    );
    return;
  }

  final file = await _picker.pickImage(
    source: ImageSource.gallery,
    imageQuality: 80,
    maxWidth: 1024,
  );

  if (file == null) return;
  profileImage.value = File(file.path);
}