DidomiSdk class

Didomi SDK Plugin

Constructors

DidomiSdk()

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

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

currentUserStatus Future<CurrentUserStatus>
Get the current user consent status as a CurrentUserStatus object
no setter
isConsentRequired Future<bool>
Determine if consent is required for the user. The rules are (OR):
no setter
isNoticeVisible Future<bool>
Check if notice is visible
no setter
isPreferencesVisible Future<bool>
Check if preferences screen is visible
no setter
isReady Future<bool>
Check if Didomi SDK was successfully initialized
no setter
isUserConsentStatusPartial Future<bool>
Determine if consent information is available for all purposes and vendors that are required
no setter
isUserLegitimateInterestStatusPartial Future<bool>
Determine if legitimate interest information is available for all purposes and vendors that are required
no setter
isUserStatusPartial Future<bool>
Determine if the user status is partial
no setter
javaScriptForWebView Future<String>
Get JavaScript to embed into a WebView to pass the consent status from the app to the Didomi Web SDK embedded into the WebView
no setter
queryStringForWebView Future<String>
Get a query-string to add to the URL of a WebView or Chrome Custom Tab to pass the consent status from the app to the Didomi Web SDK embedded on the target URL. Note: Available for Android only, will return an empty string if called from iOS
no setter
requiredPurposeIds Future<List<String>>
Get the IDs of the required purposes
no setter
requiredPurposes Future<List<Purpose>>
Get required purposes.
no setter
requiredVendorIds Future<List<String>>
Get the IDs of the required vendors
no setter
requiredVendors Future<List<Vendor>>
Get required vendors.
no setter
shouldConsentBeCollected Future<bool>
Check if user consent are partial or not set
no setter
shouldUserStatusBeCollected Future<bool>
Determine if the User Status (consent) should be collected or not. User Status should be collected if:
no setter
userStatus Future<UserStatus>
Get the user consent status as a UserStatus object
no setter

Static Methods

addEventListener(EventListener listener) → dynamic
Add listener to SDK events
addVendorStatusListener(String vendorId, dynamic listener(VendorStatus)) → dynamic
Add a listener to be triggered when the user status for the selected vendor changes
clearUser() Future<void>
Clear user information
getPurpose(String purposeId) Future<Purpose?>
Get a purpose by its id.
getText(String key) Future<Map<String, String>?>
Get a dictionary/map for a given key in the form of { en: "Value in English", fr: "Value in French" } from the didomi_config.json file containing translations in different languages.
getTranslatedText(String key) Future<String>
Get a translated string for a given key from the didomi_config.json file based on the currently selected language.
getVendor(String vendorId) Future<Vendor?>
Get a vendor by its id.
hideNotice() Future<void>
Hide the notice
hidePreferences() Future<void>
Hide the preferences screen
initialize(String apiKey, {String? localConfigurationPath, String? remoteConfigurationURL, String? providerId, bool disableDidomiRemoteConfig = false, String? languageCode, String? noticeId, String? androidTvNoticeId, bool androidTvEnabled = false}) Future<void>
Initialize the SDK
onError(dynamic callback()) → dynamic
Provide a function to be called if SDK encounters an error
onReady(dynamic callback()) → dynamic
Provide a function to be called once SDK is ready. Automatically calls the function if SDK is already ready.
openCurrentUserStatusTransaction() CurrentUserStatusTransaction
Creates a CurrentUserStatusTransaction object. This object provides mechanisms to stage updates to the user status regarding purposes and vendors, allowing for batch operations. Updates made through its methods are queued and applied simultaneously to the user status only once the commit method of the returned object is called.
removeEventListener(EventListener listener) → dynamic
Remove listener to SDK events
removeVendorStatusListener(String vendorId) → dynamic
Remove one or multiple previously added listeners for the selected vendor status
reset() Future<void>
Reset user consents
setCurrentUserStatus(CurrentUserStatus currentUserStatus) Future<bool>
Set the current user consent status as a CurrentUserStatus object
setLogLevel(LogLevel minLevel) → dynamic
Set the minimum level of messages to log
setupUI() Future<void>
Setup the UI and show the notice if needed
setUser(String organizationUserId) Future<void>
Set user information
setUserAgreeToAll() Future<bool>
Enable all purposes and vendors for the user.
setUserAndSetupUI(String organizationUserId) Future<void>
Set user information and check for missing consent
setUserDisagreeToAll() Future<bool>
Update user status to disagree : disable consent and legitimate interest purposes, disable consent vendors, but still enable legitimate interest vendors.
setUserStatus(List<String> enabledConsentPurposeIds, List<String> disabledConsentPurposeIds, List<String> enabledLIPurposeIds, List<String> disabledLIPurposeIds, List<String> enabledConsentVendorIds, List<String> disabledConsentVendorIds, List<String> enabledLIVendorIds, List<String> disabledLIVendorIds) Future<bool>
Set the user status
setUserStatusGlobally(bool purposesConsentStatus, bool purposesLIStatus, bool vendorsConsentStatus, bool vendorsLIStatus) Future<bool>
Set the user status globally
setUserWithAuthParams(UserAuthParams parameters) Future<void>
Set user information with authentication
setUserWithAuthParamsAndSetupUI(UserAuthParams parameters) Future<void>
Set user information with authentication and check for missing consent
showNotice() Future<void>
Show the notice screen if user consent is needed. Note: When calling from iOS, setupUI must have been called before.
showPreferences({PreferencesView view = PreferencesView.purposes}) Future<void>
Show the preferences screen
updateSelectedLanguage(String languageCode) Future<void>
Method used to update the selected language of the Didomi SDK and any property that depends on it.