ClikgateEngage class
Clikgate Engage (part of clikgate_flutter) for apps without their own backend: the user's referral link and stats, leaderboards, promo codes and share helpers.
Apps with a backend should call the Clikgate control-plane API from their server instead and render their own screens (recommended path).
final engage = ClikgateEngage();
final link = await engage.referrals.createLink(programId: 'rpg_...', displayName: 'Ada');
await engage.share.whatsApp(text: 'Join me on MyApp: ${link.url}');
Calls need Clikgate.configure (core plugin) and a recorded install.
Every network call checks Clikgate.isFeatureEnabled first and throws
ClikgateException(feature_disabled) without a network call when the
feature is off. Calls acting for a user (link, stats, my rank, around
me, opt-out, hosted page) throw not_identified until Clikgate.identifyUser
was called; identity_required comes from the server when the program
needs a verified identity token. Reads are cached in memory for 60 s;
network errors are retried once. No UI components.
Constructors
- ClikgateEngage({Client? httpClient, EngageCore core = const ClikgateCoreBridge(), EngageUrlOpener? openUrl, Duration cacheTtl = const Duration(seconds: 60), Duration retryDelay = const Duration(milliseconds: 500), DateTime clock()?})
Properties
- codes → EngageCodes
-
Promo / offline codes typed in the app (feature
offline_codes).final - hashCode → int
-
The hash code for this object.
no setterinherited
- leaderboards → EngageLeaderboards
-
Leaderboards published to the SDK (feature
leaderboards).final - referrals → EngageReferrals
-
Referrer side: the user's link and stats (feature
referrals).final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
System share sheet and WhatsApp (no network).
final
Methods
-
clearCache(
) → void - Drops the in-memory read cache (e.g. on pull-to-refresh).
-
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