ClikgateFake class
A fake Clikgate for widget and unit tests: see ClikgateFake.install.
Defaults: configure succeeds; getInstallationId and getInstallationHeader return
installationId and Clikgate-Installation: <appId>:<installationId>; goal answers
goalStatus (counted), and Payment goals (with a provider) paymentGoalStatus
(waiting); isFeatureEnabled reads features; referrals.applyCode succeeds unless
applyCodeError is set; attribution is attribution (organic); Engage
referrals.createLink returns a link with referralCode; share calls open nothing and are
recorded in shares. Change any of these on the fake at any time.
Properties
- appId ↔ String
-
The Clikgate app ID in the installation header:
app_and a 26-character ULID.getter/setter pair -
appliedCodes
→ List<
ClikgateFakeAppliedCode> -
Clikgate.referrals.applyCodecalls (failed ones too).final - applyCodeError ↔ String?
-
When set,
Clikgate.referrals.applyCodethrowsClikgateExceptionwith this code (code_not_found,already_referred,self_referral,window_expired, ...;existing_userthrowsExistingUserException).getter/setter pair - attribution ↔ ClikgateAttribution
-
What
Clikgate.getAttribution()returns.getter/setter pair -
calls
→ List<
MethodCall> -
Every platform-channel call, in order (
com.clikgate/sdkandcom.clikgate/engage).final -
configureArguments
↔ Map<
String, Object?> ? -
The arguments of the last
Clikgate.configurecall, or null before it.getter/setter pair - configured → bool
-
Whether
Clikgate.configurewas called.no setter - createLinkError ↔ String?
-
When set, Engage
referrals.createLinkandmyStatsthrowClikgateExceptionwith this code (identity_required,program_paused, ...).getter/setter pair - customerId → String?
-
The identified customer, as the native SDK would store it after the
identifyUsercalls.no setter -
engageRequests
→ List<
ClikgateFakeRequest> -
Requests the Engage features sent to the Clikgate API.
final
-
features
→ Map<
String, bool> -
Clikgate.isFeatureEnabledanswers; unknown keys are off. The defaults are the SDK's before its first config fetch.final -
goals
→ List<
ClikgateFakeGoal> -
Clikgate.goalcalls.final - goalStatus ↔ GoalStatus
-
The status
Clikgate.goalanswers for a goal without aprovider.getter/setter pair - hashCode → int
-
The hash code for this object.
no setterinherited
-
identifyCalls
→ List<
ClikgateFakeIdentify> -
Clikgate.identifyUsercalls.final - identityToken → String?
-
The identity token stored with customerId.
no setter
- installationId ↔ String?
-
What
Clikgate.getInstallationId()returns. Null acts like tracking off (the installation header is null too).getter/setter pair - linkDomain ↔ String
-
The link domain of fake links (
https://<linkDomain>/r/<referralCode>), and the domainClikgate.handleUrltreats as a Clikgate link.getter/setter pair - onEngageRequest ↔ Response? Function(Request request)?
-
Answers an Engage request yourself: return a response, or null for the fake's default.
For example
(r) => r.url.path.endsWith('/referrals/me') ? http.Response('...', 200) : null.getter/setter pair - onGoal ↔ GoalResult? Function(ClikgateFakeGoal goal)?
-
Overrides the goal answer: return a GoalResult for the goal, or null for the defaults.
getter/setter pair
- paymentGoalStatus ↔ GoalStatus
-
The status
Clikgate.goalanswers for a Payment goal (one with aprovider).getter/setter pair - pushToken → String?
-
The push token from
Clikgate.setPushToken, or null.no setter - redeemError ↔ String?
-
When set, Engage
codes.redeemthrowsClikgateExceptionwith this code (code_not_found,code_expired, ...).getter/setter pair - referralCode ↔ String
-
The code of the link Engage
referrals.createLinkreturns.getter/setter pair - referredBy ↔ Referral?
-
What
Clikgate.referrals.referredBy()returns: null means not referred.getter/setter pair - referrerDisplayName ↔ String
-
The referrer's name in the Referral that
applyCodereturns.getter/setter pair - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
Whether the app asked for in a share call (
share.whatsApp,share.link(app: ...)) "opens"; false falls back to the share menu, as on a phone without that app.getter/setter pair -
Engage share calls.
final
- trackingEnabled → bool
-
False after
Clikgate.setTrackingEnabled(false).no setter
Methods
-
callsTo(
String method) → List< MethodCall> -
The calls of one channel method, such as
setPushTokenorreferrals.referredBy. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pushBrowserHandoff(
String url) → void -
Delivers a browser handoff on
Clikgate.onBrowserHandoff(another organisation's link on a shared Clikgate domain). -
pushDeepLink(
String url, {String? path, Map< String, Object?> data = const {}, bool isDeferred = false, String? clickId = 'clk_fake_1', String? matchType, String linkId = 'lnk_fake_1', String linkKind = 'standard', Referral? referral}) → void -
Delivers a deep link on
Clikgate.onDeepLink, as if the phone openedurl(or, withisDeferred, as the deferred deep link after install).pathdefaults to the URL's path. Pump the widget tester afterwards so listeners run. -
toString(
) → String -
A string representation of this object.
inherited
-
uninstall(
) → void - Removes the fake (done for you when the test ends).
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
install(
{String? customerId, String? identityToken}) → ClikgateFake -
Installs a fake for the current test and returns it. Call it in
setUpor at the start of a test; it's removed when the test ends (addTearDown).