ApptiveGridClient class
Api Client to communicate with the ApptiveGrid Backend
- Inheritance
-
- Object
- ChangeNotifier
- ApptiveGridClient
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
-
getEditLink(
{required Uri uri, required String formId, Map< String, String> headers = const {}}) → Future<Uri> -
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 byspaceUri
-
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 bylayout
-
loadForm(
{required Uri uri, Map< String, String> headers = const {}, bool isRetry = false}) → Future<FormData> -
Loads a
FormData
represented byformUri
-
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 bygridUri
-
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
-
performApptiveLink<
T> ({required ApptiveLink link, bool isRetry = false, dynamic body, Map< String, String> headers = const {}, Map<String, String> ? queryParameters, required Future<T?> parseResponse(Response response)}) → Future<T?> -
Perform a action represented by
link
body
is the body of the requestheaders
will be added in addition to ApptiveGridClient.defaultHeadersqueryParameters
will override anyqueryParameters
in ApptiveLink.uriparseResponse
will be called withhttp.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
againstlink
-
submitFormWithProgress(
ApptiveLink link, FormData formData, {bool saveToPendingItems = true, Map< String, String> headers = const {}}) → Stream<SubmitFormProgressEvent> -
Submits
formData
againstlink
-
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