core library

The core of the NxFit SDK for Flutter.

To get started, look at the NxFit class, which is the entry point to the SDK. To instantiate an instance of the NxFit class use the NxFit.build method. This will provide the NxFit clients, which are used to access the NxFit API service over HTTP.

Classes

Authenticated
Indicates that the user is authenticated.
AuthProvider
AuthProvider must be supplied to NxFit.build and it is used to indicate the current authentication state. Only two states are possible: Authenticated and Unauthenticated. When the user is authenticated, the AuthState will be set to Authenticated with an appropriate accessToken and userId. Whenever the access token changes, the AuthState will be updated with a new instance of Authenticated. This will be used by the NxFit SDK when making HTTP calls to the server.
AuthState
Used by NxFit consumers to indicate the current authentication state. Only two states are possible: Authenticated and Unauthenticated. When the user is authenticated, the AuthState will be set to Authenticated with the appropriate accessToken and userId. This will be used by the NxFit SDK when making HTTP calls to the NxFit API server.
Cacheable
A Cacheable provides a mechanism for caching based on HTTP response headers.
CacheableResource<T>
Encapsulates a resource that can be cached via an eTag and lastModifiedOn. The resource can be any type, however how the resource is cached is up to the caller.
ConfigurationProvider
Defines the configuration requirements for the NxFit SDK. An implementation of this must be provided when building NxFit.
NxFit
The NxFit abstraction provides all the clients needed to access NxFit services. An NxFit client is a container that provides a set of HTTP calls to the NXFit service. A single call can retrieve single items or a list of items, it can create or update items, or in some cases remove items on the server.
NxFitManagers
The NxFit managers use the associated clients to fetch server data and store it in a local database via a sync process. This is an optional convenience component of the NxFit SDK.
NxFitRepositories
The NXFitRepositories interface provides repositories that work on top of the NXFit clients. This is an optional component of the NxFit SDK and is intended to provide cached data.
PagedList<E>
A paged list of items returned from the NXFit API. The items property contains the list of items returned in the current page. The next and previous properties contain the pagination requests for the next and previous pages respectively. If there is no next or previous page, the corresponding property will be null.
PaginationRequest
Unauthenticated
Indicates that the user is not authenticated.

Enums

HttpLoggerLevel
Determines the level of logging for HTTP requests and response from the NXFit API.
LogLevel

Functions

setBasicLogger() → void
Sets up a basic logger that prints log records to the console.

Exceptions / Errors

ConflictException
Indicates an HTTP status code of 409 CONFLICT was received.
NetworkException
NotModifiedException
Indicates an HTTP status code of 304 NOT MODIFIED was received.
UnauthorizedException
Indicates an HTTP status code of 401 UNAUTHORIZED was received.