TikiSdk class
The TIKI SDK main class. Use this to add tokenized data ownership, consent, and rewards.
TikiSdk is a singleton that keeps the latest initialized instance. All the parameters are kept when a new instance is created, except for the address
Properties
- activeTheme → Theme
-
Returns the
Theme
configured for the specified colorScheme, or the default theme if none is specified or the specified color scheme does not exist.no setter - address → String?
-
The wallet address that is in use.
no setter
- dark → Theme
-
The dark theme for TikiSdk pre-built UIs. Just used if is set in TikiSdk.
no setter
- getOnAccept → dynamic Function(Offer, LicenseRecord?)?
-
Callback function for an accepted offer.
no setter
- getOnDecline → dynamic Function(Offer, LicenseRecord?)?
-
Callback function for a declined offer.
no setter
- getOnSettings → dynamic Function(BuildContext)
-
Callback function for user tapping in settings in the settings link in
ending screen.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String?
-
The current id.
no setter
- isAcceptEndingDisabled → bool
-
Check if the ending screen is disabled for an accepted Offer.
no setter
- isDeclineEndingDisabled → bool
-
Check if the ending screen is disabled for an declined Offer.
no setter
- isInitialized → bool
-
Returns a Boolean value indicating whether the TikiSdk has been initialized.
no setter
- offer → Offer
-
Creates a new Offer to be added in TikiSdk.
no setter
-
offers
→ Map<
String, Offer> -
The map of possible Offer for the user, with its Offer.id as key.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- theme → Theme
-
The default light theme for TikiSdk pre-built UIs.
no setter
Methods
-
addOffer(
Offer offer) → TikiSdk - Adds an Offer object to the offers map, using its ID as the key.
-
disableAcceptEnding(
bool disable) → TikiSdk - Disables or enables the ending UI for accepted offers.
-
disableDeclineEnding(
bool disable) → TikiSdk - Disables or enables the ending UI for declined offers.
-
initialize(
String publishingId, String id, {Function? onComplete = null, String? origin = null, String? dbDir = null}) → Future< void> - Initializes the TIKI SDK.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onAccept(
dynamic onAccept(Offer, LicenseRecord?)) → TikiSdk - Sets the callback function for an accepted offer.
-
onDecline(
dynamic onDecline(Offer, LicenseRecord?)) → TikiSdk - Sets the callback function for a declined offer
-
onSettings(
dynamic onSettings(BuildContext)) → TikiSdk - Sets the callback function for user selecting the "settings" option in ending widget.
-
removeOffer(
String offerId) → TikiSdk - Removes an Offer object from the offers dictionary, using its ID as the key.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
all(
String ptr, {String? origin = null}) → List< LicenseRecord> - Returns all LicenseRecords associated with a given Pointer Record.
-
config(
) → TikiSdk - Starts the configuration process for the Tiki SDK instance.
-
getLicense(
String id) → LicenseRecord? - Returns the LicenseRecord for a given ID or null if the license or corresponding title record is not found.
-
getTitle(
String id) → TitleRecord? -
Retrieves the TitleRecord with the specified ID, or
null
if the record is not found. -
guard(
String ptr, List< LicenseUsecase> usecases, {List<String> ? destinations = const [], String? origin, dynamic onPass()?, dynamic onFail(String)?}) → Future<bool> - Guard against an invalid LicenseRecord for a list of usecases and destinations.
-
latest(
String ptr, {String? origin = null}) → LicenseRecord? - Returns the latest LicenseRecord for a ptr or null if the corresponding title or license records are not found.
-
license(
String ptr, List< LicenseUse> uses, String terms, {List<TitleTag> ? tags = const [], String? titleDescription, String? licenseDescription, DateTime? expiry, String? origin}) → Future<LicenseRecord> -
Creates a new
LicenseRecord
object. -
present(
BuildContext context) → Future< void> -
Presents an Offer to the user and allows them to accept or decline it, which can result in a new
LicenseRecord
being created based on the presented Offer. -
settings(
BuildContext context) → Future< void> - Presents the Tiki SDK's pre-built user interface for the settings screen, which allows the user to accept or decline the current offer.
-
title(
String ptr, {List< TitleTag> tags = const [], String? description = null, String? origin = null}) → Future<TitleRecord> - Creates a new TitleRecord, or retrieves an existing one.