RestAPIService<DataType extends Jsonable<Object> > constructor
RestAPIService<DataType extends Jsonable<Object> > ({})
Implementation
RestAPIService({
RestAPI? restAPI,
this.onInit,
required this.baseUrl,
this.dataType,
this.token,
TokenCallback? tokenCallback,
this.apiKey,
this.connectTimeout,
this.receiveTimeout,
this.sendTimeout,
this.httpClientAdapter,
}) : assert(
(((token?.isNotEmpty ?? false) && tokenCallback == null) ||
((token?.isEmpty ?? true) && tokenCallback != null)) ||
(apiKey?.isNotEmpty ?? false),
'\n\nA token or tokenCallback must be specified, only one of both.'
'\nOtherwise an apiKey must be specified.'),
tokenCallback =
tokenCallback ??= (token == null ? null : (() async => token)),
restAPI = restAPI ?? RestAPI() {
_init();
}