DevOtpClient constructor

DevOtpClient({
  1. required Uri baseUrl,
  2. required String serviceToken,
  3. String path = defaultPath,
  4. Dio? dio,
  5. @visibleForTesting bool allowInRelease = false,
})

Implementation

DevOtpClient({
  required Uri baseUrl,
  required String serviceToken,
  this.path = defaultPath,
  Dio? dio,
  @visibleForTesting bool allowInRelease = false,
})  : _serviceToken = serviceToken,
      _dio = dio ??
          Dio(
            BaseOptions(
              baseUrl: baseUrl.toString(),
              connectTimeout: const Duration(seconds: 10),
              receiveTimeout: const Duration(seconds: 10),
            ),
          ) {
  if (_isReleaseBuild && !allowInRelease) {
    throw StateError(
      'DevOtpClient недоступен в релизной сборке. Служебная выдача '
      'кодов существует только на стенде.',
    );
  }
}