adpluginx 0.0.3 adpluginx: ^0.0.3 copied to clipboard
Simple AdMangment Tool For Flutter
AdPluginX #
Smart way to maintain in app ads like google,unity,ironsource and facebook
API Reference #
Step 1:
Add adpluginx: <latest version>
Step 2:
Flutter pub get
Step 3:
Open IOS Pod File and Add Configuration
Step 4:
Wrap your Material Widget with ProviderHelper
Example
ProviderHelper(
child: MaterialApp(
title: 'Flutter Demo',
initialRoute: SplashScreen.route,
themeMode: ThemeMode.system,
onGenerateRoute: r.Router.onRouteGenrator,
theme: ThemeData(primarySwatch: Colors.green, useMaterial3: true),
),
);
Step 5:
Now Init Plugin
Example
adPluginX.initAdPluginX(
context,
response.data['adIds'],
response.data[App.appVersion]['globalClick'],
response.data[App.appVersion]['globalFail'],
response.data[App.appVersion]['screens'],
isAdsOn: response.data[App.appVersion]['isAdsOn'],
setMaxCount: response.data[App.appVersion]['maxAdFailCounter'],
);
Parameter | Type | Description / Default |
---|---|---|
context |
BuildContext |
Required. |
adIds |
Map |
Required. |
globalClick |
List |
Required. |
globalFail |
Map |
Required. |
screens |
Map |
Required. |
isAdsOn |
bool |
false. |
setMaxCount |
int |
3. |
Step 6:
To Show Loader Wrap Current Screen or Widget with AdOverlayX Widget
AdOverlayX Takes child as arugment
Step 7:
To Call Ads with Plugin Simply Use Default Classes
adNavigator(context,routeName);
adNavigatorPushReplacement(context,routeName);
adCallerClick(context,action);
That's it now we have to just make sure ios and android side plugin configurations.
Json Struture For
adsId
"adIds":{
"google":{
"fullScreen":""
},
"unity":{
"placementId":"",
"gameId":""
},
"facebook":{
"fullScreen":""
},
"ironSource":{
"appId":""
}
}
Clicks
"globalClick":[0,1,2,3]
/// Here This int Represent
/// 0 = Google
/// 1 = Unity
/// 2 = IronSource
/// 3 = Facebook
Fail
"globalClick":{"0": 1, "1": 2, "2": 3, "3": 0}
screens
{
"routeName":{
"localAdFlag":true,
"localClick": [0,1],
"localFail": {"0": 1, "1": 2, "2": 3, "3": 0}
}
}