deleteFacebook method

Future<void> deleteFacebook(
  1. String facebookUid
)

Handles facebook account deletion from bodsquare.

Implementation

Future<void> deleteFacebook(String facebookUid) async {
  final DeleteSocialMediaResponse response;
  try {
    getConnectionUrlLoadingStatus.value = true;
    // _loadingService.show(status: 'Processing');
    // loadingStatus.value = NetworkConnectionStatus.loading;
    //log('facebookUid: $facebookUid ${getConnectionUrl
    //LoadingStatus.value}');
    response = await _linkingRepository.deleteFacebookConnection(facebookUid);
    if (response.status == 'success') {
      await getSocialMediaAccounts();
      // loadingStatus.value = NetworkConnectionStatus.success;
      getConnectionUrlLoadingStatus.value = false;
      linkingSuccess.value = response.message ?? 'Facebook account Removed';
      update();

      // _loadingService
      //     .showSuccess(response.message ?? 'Facebook account Removed');
    }
  } catch (e) {
    if (e is DioError) {
      getConnectionUrlLoadingStatus.value = false;
      linkingError.value = 'Error: Unable to remove Facebook account';
      // loadingStatus.value = NetworkConnectionStatus.error;
      // _loadingService.showError('Error: Unable
      //to remove Facebook account');
    } else {
      getConnectionUrlLoadingStatus.value = false;
      // loadingStatus.value = NetworkConnectionStatus.error;
      // _loadingService.showError("Error: Unable t
      //o remove Facebook account");
      linkingError.value = "Error: Unable to remove Facebook account";
    }
  }
}