ApptiveGridClient class

Api Client to communicate with the ApptiveGrid Backend

Inheritance

Constructors

ApptiveGridClient({ApptiveGridOptions options = const ApptiveGridOptions(), Client? httpClient, ApptiveGridAuthenticator? authenticator})
Creates an ApiClient

Properties

attachmentProcessor → AttachmentProcessor
Processor for Attachments. Handles uploading attachments, creating attachments, scaling images
no setter
authenticator ↔ ApptiveGridAuthenticator
The authenticator used to authenticate requests
latefinal
defaultHeaders Map<String, String>
Headers that are used for multiple Calls
no setter
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
httpClient → Client
The underlying http client
no setter
isAuthenticated Future<bool>
Checks if the User is currently authenticated
no setter
isAuthenticatedWithToken Future<bool>
Checks if the User is currently authenticated with a Token. Returns true if the user is logged in as a user. Will return false if there is no authentication set or if the authentication is done using a ApptiveGridApiKey
no setter
options ApptiveGridOptions
Returns the ApptiveGridOptions for the current Client
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
authenticate() Future<Credential?>
Authenticate the User
dispose() → void
Close the connection on the httpClient
override
Creates and returns a Uri pointing to a Form filled with the Data represented for a given entitiy
getEntity({required Uri uri, Map<String, String> headers = const {}, ApptiveGridLayout layout = ApptiveGridLayout.field}) Future
Get a specific entity via a uri
getMe({Map<String, String> headers = const {}}) Future<User>
Get the User that is authenticated
getSpace({required Uri uri, Map<String, String> headers = const {}}) Future<Space>
Get the Space represented by spaceUri
loadEntities<T>({required Uri uri, ApptiveGridLayout layout = ApptiveGridLayout.field, List<ApptiveGridSorting>? sorting, ApptiveGridFilter? filter, bool isRetry = false, Map<String, String> headers = const {}}) Future<EntitiesResponse<T>>
Load Entities of a Grid that are accessed by uri the layout in which the entities will be returned is determined by layout
loadForm({required Uri uri, Map<String, String> headers = const {}, bool isRetry = false}) Future<FormData>
Loads a FormData represented by formUri
loadGrid({required Uri uri, List<ApptiveGridSorting>? sorting, ApptiveGridFilter? filter, bool isRetry = false, Map<String, String> headers = const {}, bool loadEntities = true}) Future<Grid>
Loads a Grid represented by gridUri
logout() Future<void>
Logs out the user
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
Perform a action represented by link body is the body of the request headers will be added in addition to ApptiveGridClient.defaultHeaders queryParameters will override any queryParameters in ApptiveLink.uri parseResponse will be called with http.Response if the request has been successful
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
sendPendingActions() Future<List<ActionItem>>
Tries to send pending ActionItems that are stored in options.cache
setOptions(ApptiveGridOptions options) Future<void>
Updates the options
setUserToken(Map<String, dynamic> tokenResponse) Future<void>
Authenticates by setting a token tokenResponse needs to be a JWT
submitForm(ApptiveLink link, FormData formData, {bool saveToPendingItems = true, Map<String, String> headers = const {}}) Future<Response?>
Submits formData against link
submitFormWithProgress(ApptiveLink link, FormData formData, {bool saveToPendingItems = true, Map<String, String> headers = const {}}) Stream<SubmitFormProgressEvent>
Submits formData against link
toString() String
A string representation of this object.
inherited
updateEnvironment(ApptiveGridEnvironment environment) Future<void>
Updates the Environment for the client and handle necessary changes in the Authenticator
uploadProfilePicture({required Uint8List bytes}) Future<Response>
Uploads bytes as the Profile Picture for the logged in user

Operators

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