DevOtpClient constructor
DevOtpClient({
- required Uri baseUrl,
- required String serviceToken,
- String path = defaultPath,
- Dio? dio,
- @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 недоступен в релизной сборке. Служебная выдача '
'кодов существует только на стенде.',
);
}
}