setLanguagesForPro method

  1. @override
Future<NetworkResponse> setLanguagesForPro(
  1. dynamic proLanguageCode
)
override

Implementation

@override
Future<NetworkResponse> setLanguagesForPro(proLanguageCode) async {
  bool isDisconnect = await WifiService.isDisconnectWhenCallApi();
  if (isDisconnect) return NetworkResponse.withDisconnect();
  try {
    Response response = await AppClientsWeb(
            requiredToken: true, token: await appPrefs.getNormalToken())
        .post(AppEndpoint.setLanguagesForPro(),
            data: {'proLanguageCode': proLanguageCode});
    return NetworkResponse.fromResponse(response,
        value: response.statusCode == 200);
  } on DioError catch (e) {
    return NetworkResponse.withErrorRequest(e);
  } catch (e) {
    return NetworkResponse.withErrorConvert(e);
  }
}