updateStatus method

dynamic updateStatus(
  1. BuildContext context, [
  2. String? statusText,
  3. String? statusId
])

Implementation

updateStatus(BuildContext context,
    [String? statusText, String? statusId]) async {
  debugPrint("updating item details--> $statusId");
  if (await AppUtils.isNetConnected()) {
    if (context.mounted) Helper.showLoading(buildContext: context);
    Mirrorfly.setMyProfileStatus(
        status: statusText!,
        statusId: statusId!,
        flyCallBack: (response) {
          if (response.isSuccess) {
            selectedStatus.value = statusText;
            addStatusController.text = statusText;
            var data = json.decode(response.data);
            toToast(AppConstants.statusUpdated);
            Navigator.pop(context);
            if (data['status']) {
              getStatusList();
            }
          }
        });
  } else {
    toToast(AppConstants.noInternetConnection);
  }
}