reportChatOrUser method

dynamic reportChatOrUser(
  1. BuildContext context
)

Implementation

reportChatOrUser(BuildContext context) {
  Future.delayed(const Duration(milliseconds: 100), () {
    Helper.showAlert(
        title: "${AppConstants.report} ${profile.name}?",
        message: AppConstants.last5Message,
        actions: [
          TextButton(
              onPressed: () {
                // Get.back();
                Navigator.pop(context);
                // Helper.showLoading(message: "Reporting User");
                Mirrorfly.reportUserOrMessages(
                    jid: profile.jid!,
                    type: "chat",
                    flyCallBack: (FlyResponse response) {
                      if (response.isSuccess) {
                        toToast(AppConstants.reportSent);
                      } else {
                        toToast(AppConstants.noMessagesAvailable);
                      }
                    });
              },
              child: Text(
                AppConstants.report.toUpperCase(),
                style:
                    TextStyle(color: MirrorflyUikit.getTheme?.primaryColor),
              )),
          TextButton(
              onPressed: () {
                // Get.back();
                Navigator.pop(context);
              },
              child: Text(AppConstants.cancel.toUpperCase(),
                  style: TextStyle(
                      color: MirrorflyUikit.getTheme?.primaryColor))),
        ],
        context: context);
  });
}