API Reference

To integrate Nudge Challenges 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.

Challenges SDK is a private SDK and is not hosted on pub.dev. Contact the Nudge team to get the hosting URL of the Challenges SDK and the pubspec.yamldefinitions.

 challengesUi = ChallengesUi();

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: [
   			challengesUi,
   		]
 ..
 ..

That's it!

Our Nudge Core would now trigger Surveys defined on your Dashboard using the challengesUi 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 challenge, which includes a URL link to redirect the user to a desired location.

Example:

  void printCallback(Map<String, dynamic> response) {
      print(response);
    }

  challengesUi.GetCallBack(printCallback);