unBlock method

dynamic unBlock(
  1. String jid,
  2. String name,
  3. BuildContext context
)

Implementation

unBlock(
  String jid,
  String name,
  BuildContext context,
) {
  Helper.showAlert(
      message: "${AppConstants.unblock} $name?",
      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);
                // Helper.progressLoading();
                Mirrorfly.unblockUser(
                    userJid: jid.checkNull(),
                    flyCallBack: (FlyResponse response) {
                      // Helper.hideLoading();
                      if (response.isSuccess && response.hasData) {
                        toToast("$name ${AppConstants.hasUnBlocked}");
                        userUpdatedHisProfile(jid);
                      }
                    });
              } else {
                toToast(AppConstants.noInternetConnection);
              }
            },
            child: Text(
              AppConstants.yes.toUpperCase(),
              style: TextStyle(color: MirrorflyUikit.getTheme?.primaryColor),
            )),
      ],
      context: context);
}