Vasat class
Vasat flutter SDK
Constructors
- Vasat({String name = defaultName, required VasatConfig config, required VasatStorageProvider storageProvider})
Properties
- config → VasatConfig
-
final
- currentSession → Session?
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- name → String
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
sessionStream
→ Stream<
Session?> -
no setter
- storageProvider ↔ VasatStorageProvider
-
getter/setter pair
Methods
-
apiDelete(
String url) → Future - ////////////////////////////////////// Base API calls and methods ////////////////////////////////////////////////////
-
apiGet(
String url, {Map< String, String> ? params, bool returnPayloadOnly = true}) → Future -
apiGetWithTokenUrl(
String url, {Map< String, String> ? params, bool returnPayloadOnly = true}) → Future -
apiMe(
) → Future< User> -
apiMultipartPost(
String url, dynamic body, List< String> filePaths) → Future -
apiPost(
String url, Map< String, dynamic> payload, {bool returnPayloadOnly = true}) → Future -
apiPostFile(
String url, File file) → Future -
apiPut(
String url, Map< String, dynamic> payload, {bool returnPayloadOnly = true}) → Future -
debug(
String message, {int? wrapWidth}) → void -
deleteFile(
String objectType, dynamic objectId, String fileName) → Future -
dispose(
) → void - Call this to dispose streams. Should be called when the app is closed
-
getApiHeaders(
{bool isJson = false}) → Map< String, String> -
getFile(
String objectType, dynamic objectId, String fileName, {String? saveToDirectory}) → Future< File> -
getFilesInfo(
String objectType, dynamic objectId) → Future -
getMultipartFile(
String path) → Future< MultipartFile> -
getObjectFileUrl<
T extends VasatModel< (T> >T entity, String fileName) → String -
getObjectImageUrl<
T extends VasatModel< (T> >T entity) → String - ////////////////////////////////////// CRUD FILES ////////////////////////////////////////////////////
-
getObjectName<
T extends Object> ({String? vasatObjectName}) → String - ////////////////////////////////////// BaseModel end point base URL helpers ////////////////////////////////////////////////////
-
getObjectUrl<
T extends VasatModel< (T> >T entity) → String -
getStorageProvider<
T extends VasatStorageProvider> () → T -
getUrlPath<
T extends VasatModel< (T> >T entity) → String -
getUrlRoot(
String vasatObjectName) → String -
hasActiveSession(
) → Future< bool> - //////////////////////////////////////Session and Current User////////////////////////////////////////////////////
-
initialize(
) → Future< Session?> - Initializes the SDK local storage and check if there is a surrent session.
-
loadCurrentSession(
) → Future< Session?> -
loadFromAssets<
T extends VasatModel< (T> >VasatFromJsonFactory< T> factory, BuildContext context) → Future<List< T> > -
loginWithClientCredentials(
) → Future< Session> - ///////////////////////////////////////////Authentication/////////////////////////////////////////////////////////
-
loginWithUserCredentials(
String username, String password) → Future< Session> -
logout(
) → Future< void> -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
passwordReset(
String email) → Future -
processAccessToken(
Map< String, dynamic> response) → Future<Session> -
processObjects<
T extends VasatModel< (T> >Map< String, dynamic> data, VasatFromJsonFactory<T> factory, {bool updateTimestamp = false}) → Future<List< T> > -
processResponse(
Response response, [bool returnPayloadOnly = true]) → Future -
saveRemote<
T extends VasatModel< (T> >T entity) → Future< String> - ////////////////////////////////////// CRUD ////////////////////////////////////////////////////
-
searchObject<
T extends VasatModel< (T> >VasatFromJsonFactory< T> factory, {Map<String, String> ? params, bool updateTimestamp = false}) → Future<List< T> > - ////////////////////////////////////// Search and Sync Methods ////////////////////////////////////////////////////
-
sendFile(
String objectType, dynamic objectId, String fileName, File file) → Future< void> -
sendFiles(
String objectType, dynamic objectId, String fileName, List< String> filePaths) → Future<void> -
signUpUser(
String username, String password, {String? name, String? email}) → Future< Session> -
signUpUserWithProps(
Map< String, dynamic> properties) → Future<Session> -
syncFromRemote<
T extends VasatModel< (T> >VasatFromJsonFactory< T> factory, {Map<String, String> ? params, bool updatesOnly = true}) → Future<bool> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
Constants
- defaultName → const String