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
-
The current tiki_theme.Theme that will be used in the prebuilt UIs.
no setter
- address → String?
-
The wallet address that is in use.
no setter
- core → TikiSdk
-
TikiSdkDart instance. The core blockchain.
no setter
- dark → Theme
-
The dark theme for TikiSdk pre-built UIs. Just used if is set in TikiSdk.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- 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
- 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
- onAccept → dynamic Function(Offer)?
-
Callback function for an accepted offer.
no setter
- onDecline → dynamic Function(Offer)?
-
Callback function for a declined offer.
no setter
- onSettings → dynamic Function(Offer)?
-
Callback function for user tapping in settings in the settings link in
ending screen.
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 a new Offer for the user;
-
disableAcceptEnding(
bool disable) → TikiSdk - Disables the ending screen for accepted Offer
-
disableDeclineEnding(
bool disable) → TikiSdk - Disables the ending screen for decline Offer
-
init(
String publishingId, {String? address, String? origin, String? databaseDir}) → Future< TikiSdk> - Initializes the TikiSdk.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setOnAccept(
dynamic onAccept(Offer)) → TikiSdk - Sets the callback function for an accepted offer.
-
setOnDecline(
dynamic onDecline(Offer)) → TikiSdk - Sets the callback function for a declined offer
-
setOnSettings(
dynamic onSettings(Offer)) → TikiSdk - Sets the callback function for user selecting the "settings" option in ending widget.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
config(
) → TikiSdk - Starts the TikiSdk configuration.
-
guard(
String ptr, List< LicenseUsecase> usecases, {dynamic onPass, dynamic onFail}) → Future<bool> -
Verifies if there is an active License for the
usecases
of the Title identified byptr
. -
license(
Offer offer, bool accepted) → Future< LicenseRecord> -
Creates a new License, based on the the user choice about the
offer
. -
present(
BuildContext context) → Future< void> - Shows the pre built UI Offer Flow.
-
settings(
BuildContext context) → Future< void> - Shows the pre built Settings UI