client method

Dio client({
  1. bool requireAuth = false,
  2. bool routing = false,
})

Implementation

Dio client({bool requireAuth = false, bool routing = false}) => Dio(
      BaseOptions(
        baseUrl: routing ? AppConstants.drawingBaseUrl :  AppConstants.devBaseUrl,
        connectTimeout: const Duration(seconds: 20),
        receiveTimeout: const Duration(seconds: 20),
        sendTimeout: const Duration(seconds: 20),
        headers: {
          'Accept':
              'application/json, application/geo+json, application/gpx+xml, img/png; charset=utf-8',
          'Content-type': 'application/json'
        },
      ),
    )
      ..interceptors.add(TokenInterceptor(requireAuth: requireAuth))
      ..interceptors.add(LogInterceptor(
          responseHeader: false,
          requestHeader: true,
          responseBody: true,
          requestBody: true));