PubClient constructor
PubClient({
- String? pubUrl,
- Credentials? credentials,
- Client? client,
- bool debug = false,
- String? userAgent,
Implementation
PubClient({
this.pubUrl,
Credentials? credentials,
http.Client? client,
this.debug = false,
String? userAgent,
}) : endpoint = Endpoint(pubUrl) {
http.Client httpClient;
if (credentials == null) {
httpClient = http.Client();
} else {
httpClient = Client(
credentials,
identifier: PubAuth.identifier,
secret: PubAuth.secret,
);
}
userAgent ??= 'default';
_headers = {
'user-agent': 'pub_api_client/$packageVersion ($userAgent)',
};
_client = client ?? httpClient;
}