unBlock method

dynamic unBlock(
  1. ProfileDetails item,
  2. BuildContext context
)

Implementation

unBlock(ProfileDetails item, BuildContext context) {
  Helper.showAlert(
      message: "${AppConstants.unblock} ${getName(item)}?",
      actions: [
        TextButton(
            onPressed: () {
              // Get.back();
              Navigator.pop(context);
            },
            child: Text(
              AppConstants.no.toUpperCase(),
              style: TextStyle(color: MirrorflyUikit.getTheme?.primaryColor),
            )),
        TextButton(
            onPressed: () async {
              if (await AppUtils.isNetConnected()) {
                // Get.back();
                if (context.mounted) Navigator.pop(context);
                if (context.mounted) Helper.progressLoading(context: context);
                Mirrorfly.unblockUser(
                    userJid: item.jid.checkNull(),
                    flyCallBack: (FlyResponse response) {
                      Helper.hideLoading(context: context);
                      if (response.isSuccess) {
                        toToast(
                            "${getName(item)} ${AppConstants.hasUnBlocked}");
                        userUpdatedHisProfile(item.jid.checkNull());
                      }
                    });
              } else {
                toToast(AppConstants.noInternetConnection);
              }
            },
            child: Text(AppConstants.yes.toUpperCase(),
                style:
                    TextStyle(color: MirrorflyUikit.getTheme?.primaryColor))),
      ],
      context: context);
}