deleteTwitter method

Future<void> deleteTwitter(
  1. String twitterUid
)

Disconnect Social Media account

Handles twitter account deletion from bodsquare.

Implementation

Future<void> deleteTwitter(String twitterUid) async {
  final DeleteSocialMediaResponse response;
  try {
    _loadingService.show(status: 'Processing');
    response = await _linkingRepository.deleteTwitterConnection(twitterUid);
    if (response.status == 'success') {
      await getSocialMediaAccounts();
      _loadingService
          .showSuccess(response.message ?? 'Twitter account Removed');
    }
  } catch (e) {
    if (e is DioError) {
      _loadingService.showError("Error: Unable to remove Twitter account");
    } else {
      _loadingService.showError("Error: Unable to remove Twitter account");
    }
  }
}