A Flutter package for dcoupon SDK. dcoupon SDK allows our clients to log in their users into the dcoupon service, so users can benefit from accessing dcoupon service from 3rd party apps, without needing to use an additional login for dcoupon.


To use this plugin, add dcoupon_sdk_flutter_package as a dependency in your pubspec.yaml file.

MUST DO: Set up dcoupon SDK

To start using dcoupon SDK methods, you need to provide contents of a json file to the SDK.

  1. Add a json file to your app with the following:
  "com.dcoupon.sdk.ClientToken": "<YOUR_CLIENT_TOKEN_HERE>",
  "com.dcoupon.sdk.ClientSecretKey": "<YOUR_CLIENT_SECRET_KEY_HERE>",
  "com.dcoupon.sdk.ClientCountry": "<YOUR_CLIENT_COUNTRY_2_LETTER_CODE_HERE>",
  "com.dcoupon.sdk.ClientDomain": "<YOUR_CLIENT_DOMAIN_HERE>",
  "com.dcoupon.sdk.ClientPublishers": [
  1. Read the json
var jsonContents = await rootBundle.loadString("lib/assets/config/your_json_name.json");
  1. Configure the SDK with the json contents
final dcoupon = Dcoupon(context: context);
final dcoupon = Dcoupon()
dcoupon.setContext(context) //Can assign context later

await dcoupon.loadConfig(jsonContents);


Future<void> login() async {
    // do login
      alias: alias,
      gender: gender,
      birthdate: birthdate,
        .then((response) async {
      //User authenticated in dcoupon, you can call other methods
      DcouponListener response = await dcoupon.getCoupons(
                offset: int.parse(start),
                limit: int.parse(limit),
                sortBy: sortBy,
                companyTokens: companyTokens,
                retailerTokens: retailerTokens,

    }).catchError((ex) {
      print("example.app.login.catchError: " + ex.toString());

API reference

You can check the API reference in this page or go to dcoupon SDK API reference


A flutter package for dcoupon SDK.