addTwitterAccount method

void addTwitterAccount(
  1. AddTwitterChannelRequest request
)

add twitter account after connecting with twitter API

Implementation

void addTwitterAccount(AddTwitterChannelRequest request) async {
  GetTwitterResponse response;
  try {
    //log('twitter final request: ${request.toString()}');
    _loadingService.show(status: 'Processing');
    response = await _linkingRepository.addTwitterConnection(request);
    if (response.status == 'success') {
      //log(response.toString());

      await getSocialMediaAccounts();

      _loadingService.dismiss();

      _loadingService.dismiss();
    } else {
      _loadingService.showError(response.message.toString());
    }
  } catch (e) {
    if (e is DioError) {
      _loadingService.showError(e.response?.data['message']);
    } else {
      _loadingService.showError(e.toString());
    }
  }
}