TwkApiV1 class abstract

Tawakkalna SDK Helper for V1 API

This class provides access to all V1 endpoints of the Tawakkalna SDK. Most methods correspond to the JavaScript window.TWK.* functions.

Implementers

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

addDocument({required String documentName, required String documentContent, required String referenceNumber, required int categoryId}) → Future<void>
Add document to user's storage Corresponds to: window.TWK.addDocument(documentName, documentContent, referenceNumber, categoryId)
apiLog({required String url, required int methodType, String? requestBody, Map<String, String>? requestHeaders, DateTime? requestDateTime, String? responseBody, Map<String, String>? responseHeaders, DateTime? responseDateTime, required int responseCode}) → Future<void>
API log with detailed request/response information Corresponds to: window.TWK.apiLog(url, methodType, requestBody, requestHeaders, requestDateTime, responseBody, responseHeaders, responseDateTime, responseCode)
askCameraPermission() → Future<Map<String, dynamic>>
Ask user for camera permission Corresponds to: window.TWK.askCameraPermission()
askGalleryPermission() → Future<Map<String, dynamic>>
Ask user for gallery permission Corresponds to: window.TWK.askGalleryPermission()
askPushNotificationPermission() → Future<Map<String, dynamic>>
Ask user for push notification permission Corresponds to: window.TWK.askPushNotificationPermission()
askUserLocationPermission() → Future<Map<String, dynamic>>
Ask user for location permission Corresponds to: window.TWK.askUserLocationPermission()
askUserPreciseLocationPermission() → Future<Map<String, dynamic>>
Ask user for precise location permission Corresponds to: window.TWK.askUserPreciseLocationPermission()
authenticateBiometric() → Future<Map<String, dynamic>>
Authenticate using biometric Corresponds to: window.TWK.authenticateBiometric()
deleteDocument({required String referenceNumber, required int categoryId}) → Future<void>
Delete document Corresponds to: window.TWK.deleteDocument(referenceNumber, categoryId)
generalLog({required String eventName, required int logType, required String logMessage}) → Future<void>
General log with event name, log type, and message Corresponds to: window.TWK.generalLog(eventName, logType, logMessage)
generateToken() → Future<Map<String, dynamic>>
Generate authentication token Corresponds to: window.TWK.generateToken()
getCameraPhoto() → Future<Map<String, dynamic>?>
Capture photo using camera Corresponds to: window.TWK.getCameraPhoto()
getCameraVideo() → Future<Map<String, dynamic>?>
Capture video using camera Corresponds to: window.TWK.getCameraVideo()
getDeviceInfo() → Future<Map<String, dynamic>>
Get device information and capabilities Corresponds to: window.TWK.getDeviceInfo()
getFileBase64() → Future<String?>
Get file as base64 string Corresponds to: window.TWK.getFileBase64()
getFileId() → Future<String?>
Get file ID Corresponds to: window.TWK.getFileId()
getGalleryMulti() → Future<List<Map<String, dynamic>>>
Get multiple images from gallery Corresponds to: window.TWK.getGalleryMulti()
getGalleryMultiVideo() → Future<List<Map<String, dynamic>>>
Get multiple videos from gallery Corresponds to: window.TWK.getGalleryMultiVideo()
getGallerySingle() → Future<Map<String, dynamic>?>
Get single image from gallery Corresponds to: window.TWK.getGallerySingle()
getGallerySingleVideo() → Future<Map<String, dynamic>?>
Get single video from gallery Corresponds to: window.TWK.getGallerySingleVideo()
getImage(String nationalId) → Future<Uint8List?>
Get image by national ID Corresponds to: window.TWK.getImage(nationalId)
getRawData(TwkFile file) → Future<Uint8List>
Get raw data from a file Corresponds to: window.TWK.getRawData(file)
getUserBirthCity() → Future<Map<String, dynamic>>
Get user's birth city Corresponds to: window.TWK.getUserBirthCity()
getUserBirthDate() → Future<Map<String, dynamic>>
Get user's birth date Corresponds to: window.TWK.getUserBirthDate()
getUserBloodType() → Future<Map<String, dynamic>>
Get user's blood type Corresponds to: window.TWK.getUserBloodType()
getUserDegreeType() → Future<Map<String, dynamic>>
Get user's degree/education type Corresponds to: window.TWK.getUserDegreeType()
getUserDisabilityType() → Future<Map<String, dynamic>>
Get user's disability type Corresponds to: window.TWK.getUserDisabilityType()
getUserDocumentNumber() → Future<Map<String, dynamic>>
Get user's document number Corresponds to: window.TWK.getUserDocumentNumber()
getUserEmail() → Future<Map<String, dynamic>>
Get user's email Corresponds to: window.TWK.getUserEmail()
getUserFamilyMembers({int? minAge, int? maxAge, int? gender}) → Future<Map<String, dynamic>>
Get user's family members with optional filters Corresponds to: window.TWK.getUserFamilyMembers(minage, maxage, gender)
getUserFullName() → Future<Map<String, String>>
Get user's full name (Arabic and English) Corresponds to: window.TWK.getUserFullName()
getUserGender() → Future<Map<String, dynamic>>
Get user's gender Corresponds to: window.TWK.getUserGender()
getUserHealthStatus() → Future<Map<String, dynamic>>
Get user's health status Corresponds to: window.TWK.getUserHealthStatus()
getUserId() → Future<Map<String, dynamic>>
Get user's national ID Corresponds to: window.TWK.getUserId()
getUserIdExpiryDate() → Future<Map<String, dynamic>>
Get user's ID expiry date Corresponds to: window.TWK.getUserIdExpiryDate()
getUserIqamaType() → Future<Map<String, dynamic>>
Get user's iqama type Corresponds to: window.TWK.getUserIqamaType()
getUserLocation() → Future<Map<String, dynamic>>
Get user's location Corresponds to: window.TWK.getUserLocation()
getUserMaritalStatus() → Future<Map<String, dynamic>>
Get user's marital status Corresponds to: window.TWK.getUserMaritalStatus()
getUserMobileNumber() → Future<Map<String, dynamic>>
Get user's mobile number Corresponds to: window.TWK.getUserMobileNumber()
getUserNationalAddress() → Future<Map<String, dynamic>>
Get user's national address Corresponds to: window.TWK.getUserNationalAddress()
getUserNationality() → Future<Map<String, dynamic>>
Get user's nationality name Corresponds to: window.TWK.getUserNationality()
getUserNationalityIso() → Future<Map<String, dynamic>>
Get user's nationality ISO code Corresponds to: window.TWK.getUserNationalityISO()
getUserOccupation() → Future<Map<String, dynamic>>
Get user's occupation Corresponds to: window.TWK.getUserOccupation()
getUserPaidViolations() → Future<Map<String, dynamic>>
Get user's paid violations Corresponds to: window.TWK.getUserPaidViolations()
getUserPassports() → Future<Map<String, dynamic>>
Get user's passports Corresponds to: window.TWK.getUserPassports()
getUserProfilePhoto() → Future<Map<String, dynamic>>
Get user's profile photo Corresponds to: window.TWK.getUserProfilePhoto()
getUserSponsors({int? minAge, int? maxAge, int? gender}) → Future<Map<String, dynamic>>
Get user's sponsors with optional filters Corresponds to: window.TWK.getUserSponsors(minage, maxage, gender)
getUserType() → Future<Map<String, dynamic>>
Get user's type (citizen, resident, visitor, etc.) Corresponds to: window.TWK.getUserType()
getUserUnPaidViolations() → Future<Map<String, dynamic>>
Get user's unpaid violations Corresponds to: window.TWK.getUserUnPaidViolations()
getUserVehicles() → Future<Map<String, dynamic>>
Get user's vehicles Corresponds to: window.TWK.getUserVehicles()
livenessCheckCamera({List<Map<String, dynamic>>? configurations}) → Future<Map<String, dynamic>?>
Liveness check using camera with configurations Corresponds to: window.TWK.livenessCheckCamera(configurations)
livenessCheckImageFromFiles({List<Map<String, dynamic>>? configurations}) → Future<Map<String, dynamic>?>
Liveness check from file image with configurations Corresponds to: window.TWK.livenessCheckImageFromFiles(configurations)
livenessCheckImageFromGallery({List<Map<String, dynamic>>? configurations}) → Future<Map<String, dynamic>?>
Liveness check from gallery image with configurations Corresponds to: window.TWK.livenessCheckImageFromGallery(configurations)
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
openScreen({required String screenType, Map<String, dynamic>? params}) → Future<void>
Open screen with parameters Corresponds to: window.TWK.openScreen(screenType, valuesParam)
openService({required String serviceId, Map<String, dynamic>? params}) → Future<void>
Open service by ID with parameters Corresponds to: window.TWK.openService(serviceId, valuesParam)
openUrl({required String url, required int urlType}) → Future<void>
Open URL with specified type Corresponds to: window.TWK.openUrl(url, urlType)
postCard({required String actionType, required Map<String, dynamic> payload}) → Future<void>
Post card with action type and payload Corresponds to: window.TWK.postCard(actionType, payload)
scanCode() → Future<String?>
Scan QR/Barcode Corresponds to: window.TWK.scanCode()
setPaymentConfiguration({required List<String> callbackSuccessUrlList, required List<String> callbackFailureUrlList, required String successPageName, required String failurePageName}) → Future<void>
Set payment configuration Corresponds to: window.TWK.setPaymentConfiguration(callbackSuccessUrlList, callbackFailureUrlList, successPageName, failurePageName)
share({required String fileName, required String content, required String mimeType}) → Future<void>
Share file with base64 content Corresponds to: window.TWK.share(fileName, content, mimetype)
shareScreenShot() → Future<void>
Share screenshot Corresponds to: window.TWK.shareScreenShot()
startApiIntercept() → Future<void>
Start API interceptor to automatically log API calls Corresponds to: window.TWK.startApiIntercept()
toString() → String
A string representation of this object.
inherited
updateDocument({required String documentName, required String documentContent, required String referenceNumber, required int categoryId}) → Future<void>
Update existing document Corresponds to: window.TWK.updateDocument(documentName, documentContent, referenceNumber, categoryId)

Operators

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