Complete reference for the Azakaw Flutter SDK (azakaw_kyc_flutter).
AzakawKyc.start
static Future<AzakawKycResult> start({
required BuildContext context,
required AzakawKycConfig config,
AzakawKycResultCallback? onComplete,
AzakawKycResultCallback? onCancel,
AzakawKycErrorCallback? onError,
AzakawExternalUrlCallback? onExternalUrl,
Widget? loadingIndicator,
})
Presents the onboarding flow and resolves once the user leaves it.
| Parameter | Type | Description |
|---|
context | BuildContext | Used to push the route. |
config | AzakawKycConfig | See Configuration. |
onComplete | void Function(AzakawKycResult)? | Called on successful completion. |
onCancel | void Function(AzakawKycResult)? | Called when the user backs out. |
onError | void Function(AzakawKycException)? | Called when the portal fails to load. |
onExternalUrl | void Function(Uri)? | Called for non-http(s) links the WebView will not open. |
loadingIndicator | Widget? | Replaces the default spinner. |
AzakawKycConfig
See Configuration for the full option table.
| Member | Type | Description |
|---|
isUnavailableCombination | bool | true for a sandbox pairing with no provisioned host (KSA, Qatar). |
copyWith(...) | AzakawKycConfig | Returns a copy with the given fields replaced. |
AzakawTenantResolver
static Future<AzakawTenantResolution> resolve({
required String authUrl,
required String sessionId,
required String regionName,
required String environmentName,
http.Client? client,
Duration timeout = const Duration(seconds: 4),
})
Looks the session up before the first page load. Called automatically when
resolveTenantHost is on; exposed for hosts that want to resolve the domain
themselves. See Tenant domains.
AzakawTenantResolution
| Member | Type | Description |
|---|
host | String? | Tenant hostname from the token's baseUrl claim, when there is one. |
sessionError | AzakawKycException? | Set when the backend rejected the session (401/403/404) — almost always the wrong region or environment. |
isRejected | bool | Whether sessionError is set. |
A rejection fails the flow with a clear message rather than loading the
portal, which would otherwise fall back to its login screen and look like an
SDK fault. Server-side failures (5xx), timeouts and malformed responses are
not rejections: the flow loads the region host as normal.
decodeJwtPayload(String? jwt) returns a token's claims without verifying
its signature, or null if it is not a readable JWT.
Enums
AzakawRegion
| Value | wireName | domain | Production | Sandbox |
|---|
AzakawRegion.uae | UAE | azakaw.com | app | sandbox |
AzakawRegion.ksa | KSA | azakawksa.com | app | — |
AzakawRegion.qatar | Qatar | azakawqatar.com | app | — |
AzakawRegion.kuwait | Kuwait | azakaw.com | kuwait | kuwait-stg |
| Member | Type | Description |
|---|
subdomainFor(AzakawEnvironment) | String? | Subdomain for that pairing; null when it is not provisioned. |
hasSandbox | bool | Whether the region has a sandbox at all. |
AzakawEnvironment
| Value | wireName |
|---|
AzakawEnvironment.sandbox | Sandbox |
AzakawEnvironment.production | Production |
The subdomain is not a property of the environment alone — see
AzakawRegion.subdomainFor.
AzakawLanguage
| Value | code | Notes |
|---|
AzakawLanguage.en | en | LTR |
AzakawLanguage.ar | ar | RTL |
AzakawKycStatus
| Value | Meaning |
|---|
completed | The portal reported OnboardingCompleted. |
cancelled | The user backed out. |
failed | The portal could not be loaded; see AzakawKycResult.error. |
AzakawKycResult
| Member | Type | Description |
|---|
status | AzakawKycStatus | How the run ended. |
sessionId | String | The session the run was started with. |
error | AzakawKycException? | Set only when status is failed. |
isCompleted / isCancelled / isFailed | bool | Convenience getters. |
AzakawKycException
| Member | Type | Description |
|---|
message | String | What went wrong. |
statusCode | int? | Set when the failure was an HTTP error. |
url | String? | The URL being loaded at the time. |
AzakawKycView
The widget behind AzakawKyc.start, for embedding the flow in your own
layout. See Usage.
| Property | Type | Description |
|---|
config | AzakawKycConfig | Required. |
onCompleted | AzakawKycCompletedCallback? — void Function() | Portal reported completion. |
onCancelled | AzakawKycCancelledCallback? — void Function() | User confirmed closing. |
onError | AzakawKycErrorCallback? — void Function(AzakawKycException) | Load failure. |
onExternalUrl | AzakawExternalUrlCallback? — void Function(Uri) | Non-http(s) navigation. |
loadingIndicator | Widget? | Replaces the default spinner. |
AzakawKycViewState.requestClose() shows the close confirmation and returns
whether the user confirmed. When they confirm, it also calls onCancelled, so
handle the navigation there rather than on the returned value.
URL helpers
AzakawUrls resolveAzakawUrls({
required AzakawRegion region,
required AzakawEnvironment environment,
})
Returns baseUrl, apiUrl and authUrl for a pairing. See
Configuration.
kAzakawPortalSdkVersion is the protocol version reported to the portal. It
tracks the Web SDK's sdkVersion and is not the pub package version.
Events
| Event | Returns | Description |
|---|
onComplete | AzakawKycResult | Fired when the user completes the onboarding. |
onCancel | AzakawKycResult | Fired when the user closes the flow. |
onError | AzakawKycException | Fired when the portal cannot be loaded. |