getBaseOptions static method

BaseOptions getBaseOptions({
  1. required String baseUrl,
  2. Duration defaultTimeout = const Duration(minutes: 1),
})

Implementation

static BaseOptions getBaseOptions({
  required String baseUrl,
  Duration defaultTimeout = const Duration(minutes: 1),
}) {
  return BaseOptions(
    baseUrl: baseUrl,
    headers: {
      HttpHeaders.contentTypeHeader: 'application/json; charset=utf-8',
      HttpHeaders.acceptHeader: 'application/json',
    },
    connectTimeout: defaultTimeout,
    sendTimeout: defaultTimeout,
    receiveTimeout: defaultTimeout,
  );
}