onGalleryClick method

dynamic onGalleryClick()

Implementation

onGalleryClick() async {
  // if (await askStoragePermission()) {
  AppPermission.getStoragePermission(context).then((value) {
    if (value) {
      try {
        // imagePicker();
        // Get.toNamed(Routes.galleryPicker, arguments: {
        //   "userName": getName(profile),
        //   'profile': profile,
        //   'caption': messageController.text
        // });
        if (context.mounted) {
          setOnGoingUserGone();
          Navigator.push(
              context,
              MaterialPageRoute(
                  builder: (con) => GalleryPickerView(
                      senderJid: profile.jid.checkNull(),
                      caption: messageController.text.trim()))).then((value) =>  setOnGoingUserAvail());
        }
      } catch (e) {
        debugPrint(e.toString());
      }
    }
  });
  /*if (await AppPermission.checkPermission(context, Permission.storage, filePermission, Constants.filePermission)) {
    try {
      // imagePicker();
      // Get.toNamed(Routes.galleryPicker, arguments: {
      //   "userName": getName(profile),
      //   'profile': profile,
      //   'caption': messageController.text
      // });
      if(context.mounted) {
        Navigator.push(context, MaterialPageRoute(builder: (con) =>
            GalleryPickerView(
                senderJid: profile.jid.checkNull(),
                caption: messageController.text)));
      }

    } catch (e) {
      debugPrint(e.toString());
    }
  }*/
}