create static method

UserService create(
  1. Client httpClient,
  2. Uri baseUrl,
  3. RequestInterceptor authInterceptor
)

Implementation

static UserService create(
    http.Client httpClient, Uri baseUrl, RequestInterceptor authInterceptor) {
  final client = ChopperClient(
      client: httpClient,
      baseUrl: baseUrl,
      interceptors: [
        HttpRequestLoggingInterceptor(),
        authInterceptor,
      ],
      converter: const JsonSerializableConverter({
        User: User.fromJson,
        UserFallbackTimeZone: UserFallbackTimeZone.fromJson,
        RefreshResponse: RefreshResponse.fromJson,
        ProvidersResponse: ProvidersResponse.fromJson,
        CreateUserResponse: CreateUserResponse.fromJson,
        DeleteUserResponse: DeleteUserResponse.fromJson,
        DeregisterProviderResponse: DeregisterProviderResponse.fromJson,
        GetAllUsersResponse: GetAllUsersResponse.fromJson,
        CreateSignInTokenResponse: CreateSignInTokenResponse.fromJson,
      }));

  return _$UserService(client);
}