dreampad/lib/app/api/base_provider.dart
2023-11-28 10:45:09 +08:00

17 lines
552 B
Dart

import 'package:get/get.dart';
import 'api_constants.dart';
import 'interceptors/adapter_interceptor.dart';
import 'interceptors/request_interceptor.dart';
import 'interceptors/response_interceptor.dart';
class BaseProvider extends GetConnect {
@override
void onInit() {
httpClient.baseUrl = ApiConstants.baseUrl;
httpClient.timeout = const Duration(seconds: 180);
httpClient.addRequestModifier(requestInterceptor);
httpClient.addResponseModifier(responseInterceptor);
httpClient.addResponseModifier(adapterInterceptor);
}
}