To integrate Nudge Scratch Cards 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.
scratchCardUi = NudgeScratchCardUI('YOUR_TOKEN_HERE');
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: [
scratchCardUi,
]
..
..
That's it!
Our Nudge Core would now trigger Surveys defined on your Dashboard using the scratchCardUI
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 a scratch card, which includes a URL link to redirect the user to a desired location.
Example:
void openlink(String url) {
print(url);
}
scratchUi.GetCallBack(openlink);