PlexNetworking class

Properties

addHeaders Future<Map<String, String>> Function()?
Override this callback to always attach headers in the request i.e. UserId, AuthToken etc.
getter/setter pair
defaultTimeout Duration
Default timeout for HTTP requests. Applied when no per-request timeout is provided.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addInterceptor(PlexInterceptor interceptor) → void
Add an interceptor to the pipeline. Runs in order of addition.
allowBadCertificateForHTTPS({HttpOverrides? customOverrides}) → dynamic
Call this method to allow bad https certificate and manually verify them. If you trust your API server and it's certificate you can override the HTTPS system check
clearCache({String? urlPattern}) Future<void>
Clear the HTTP cache. If urlPattern is provided, only matching entries are cleared.
delete(String url, {Map<String, dynamic>? query, Map<String, String>? headers, dynamic body, Duration? timeout, PlexCancelToken? cancelToken}) Future<PlexApiResponse>
downloadFile(String url, {required String filename, required dynamic onProgressUpdate(int downloaded, double? percentage, File? file)}) Future
url will be used as download url for the file
enableCache(PlexCacheConfig config, PlexDb db) Future<void>
Enable response caching for GET requests.
get(String url, {Map<String, dynamic>? query, Map<String, String>? headers, Duration? timeout, PlexCancelToken? cancelToken}) Future<PlexApiResponse>
getTyped<T>(String url, {required T fromJson(Map<String, dynamic>), Map<String, dynamic>? query, Map<String, String>? headers, Duration? timeout, PlexCancelToken? cancelToken}) Future<PlexApiResponse<T>>
GET with type-safe response parsing.
isNetworkAvailable() Future<bool>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
post(String url, {Map<String, dynamic>? query, Map<String, String>? headers, Map<String, dynamic>? formData, dynamic body, Duration? timeout, PlexCancelToken? cancelToken}) Future<PlexApiResponse>
postMultipart(String url, {Map<String, dynamic>? query, Map<String, String>? headers, required Map<String, String> formData, required Map<String, File> files, Duration? timeout, PlexCancelToken? cancelToken}) Future<PlexApiResponse>
postMultipart2(String url, {Map<String, dynamic>? query, Map<String, String>? headers, required Map<String, String> formData, required Map<String, File> files, Duration? timeout, PlexCancelToken? cancelToken}) Future<PlexApiResponse>
postTyped<T>(String url, {required T fromJson(Map<String, dynamic>), Map<String, dynamic>? query, Map<String, String>? headers, Map<String, dynamic>? formData, dynamic body, Duration? timeout, PlexCancelToken? cancelToken}) Future<PlexApiResponse<T>>
POST with type-safe response parsing.
put(String url, {Map<String, dynamic>? query, Map<String, String>? headers, Map<String, dynamic>? formData, dynamic body, Duration? timeout, PlexCancelToken? cancelToken}) Future<PlexApiResponse>
removeInterceptor(PlexInterceptor interceptor) → void
Remove an interceptor.
setBasePath(String? basePath) → void
Optional basePath If you not set base path it will suppose you enter complete url in post & download function parameter
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

instance PlexNetworking
getter/setter pair