To integrate Nudge Streak UI into Flutter, you need to make sure that the basic integration of the Nudge Core SDK is done, if you have not already done it, check here.
Streaks SDK is a private SDK and is not hosted on pub.dev. Contact the Nudge team to get the hosting URL of the Streaks SDK and the pubspec.yaml
definitions.
streakUI = StreakUI();
Once you have integrated the Nudge Code SDK, just add the above-defined variable into the list inplugins
property of NudgeProvider
..
..
NudgeProvider(
app: nudge,
plugins: [
streakUI,
]
..
..
That's it!
Our Nudge Core would now trigger Surveys defined on your Dashboard using the streakUI
plugin.
Add-on Integrations
Callback Function
The GetCallBack
function from the Nudge class enables you to set up a callback mechanism to receive notifications from any screen within the Nudge package. This feature proves particularly useful when handling specific actions or events, such as a Call-to-Action (CTA) callback following the completion of a streak, which includes a URL link to redirect the user to a desired location.
Example:
void printCallback(Map<String, dynamic> response) {
print(response);
}
streakUI.GetCallBack(printCallback);