Step-1

Firstly we install plugin library :- flutter pub add flutter_conscentsdkplug ,

And then import that package in your project to access

import 'package:flutter_conscentsdkplug/flutter_conscentsdkplug.dart';

Step-2 In your sample project class, pass client_id and Environment Mode to be used in your app as below sample project (a) contentID:- This will be your article or content id for which detail needs to be checked. (b) Client ID:- Pass your client_id received from Conscent.

Step-3 Conscent CallBack Reference: You can pass a callbackReference which will get called after success or failure in processing. If you pass a callbackReference, after successfull processing, the success reference will be called and for failed event, failure event will be called. You can implement ConscentCallBack in your activity and then pass it as a reference.

● success: This is the success callback which will get called for every successfull processing.You can pass your method as a reference or an lambda expression which will get called in case of success.

● failure: This is optional. You can pass it as null. This is the failure callback which will get called for every failed processing. You can pass your method as a reference or an lambda expression and it'll get called for failed cases. You can implement your code in it for failed cases.

● subscribe: This is optional callback. If you want to inflate subscribe layout, pass a subcribe function which will be called when subscribe button will be clicked inside payment flow.Passing null will not inflate subscribe layout.

● signIn: This is the callback function which will be called when a user click on signIn button in payment flow. This will be only visible if subscribe layout has been inflated.

● showSubscribe: Type boolean, pass this as "true" to show subscribe layout else "false

this class MyApppp on plugin, you have call that function on your project to show the plugin

import 'package:coloredcontainer/defaultSubscribtion.dart';

MyApppp((response) { dynamic data = jsonDecode(response); contentAccessModel = ContentAccessModel.fromJson(data); if (contentAccessModel != null && contentAccessModel?.signature != null) { showContent = true; } else { showContent = false; } print(showContent); setState(() {}); (context as Element).reassemble(); }))

FutureBuilder<ContentAccessModel?>( future: getLoginChallengeId(), builder: (context, snapshot) { var responseDttta = snapshot.data; print(responseDttta?.signature); if (snapshot.hasData) { return Center( child: Column( children: [ responseDttta?.signature == null ? Padding( padding: EdgeInsets.all(20.0), child: Text( 'Early use Scientists are still debating when people started wearing clothes. ', maxLines: showContent ? null : 4, ), ) : SizedBox.shrink(), showContent ? Container() : Expanded( flex: 2, // child: MyApppp((response) child: responseDttta?.signature != null ? Center( child: Text( 'Early use Scientists are still debating when people started wearing clothes. , ) : MyApppp((response) { // dynamic data = jsonDecode(response); // contentAccessModel = ContentAccessModel.fromJson(data); if (responseDttta != null && responseDttta.signature != null) { showContent = true; } else { showContent = false; } print(showContent); setState(() {});

                                      (context as Element).reassemble();
                                    })),
                    ],
                  ),
                );
              } else if (snapshot.hasError) {
                return Text('error');
              } else {
                return SizedBox.shrink();
              }
            }),