cs_ironsource_ad 0.0.1 copy "cs_ironsource_ad: ^0.0.1" to clipboard
cs_ironsource_ad: ^0.0.1 copied to clipboard

outdated

Ironsource adware

example/lib/main.dart

import 'dart:developer';

import 'package:flutter/material.dart';
import 'package:cs_ironsource_ad/cs_ironsource_ad.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();

    CsIronsourceAd().setOfferwallAvailable(offerwallAvailable);
    CsIronsourceAd().setOfferwallOpened(offerwallOpened);
    CsIronsourceAd().setOfferwallShowFailed(offerwallShowFailed);
    CsIronsourceAd().setOfferwallAdCredited(offerwallAdCredited);
    CsIronsourceAd().setGetOfferwallCreditsFailed(getOfferwallCreditsFailed);
    CsIronsourceAd().setOfferwallClosed(offerwallClosed);

    CsIronsourceAd().setRewardedVideoAdOpened(rewardedVideoAdOpened);
    CsIronsourceAd().setRewardedVideoAdClosed(rewardedVideoAdClosed);
    CsIronsourceAd().setRewardedVideoAvailabilityChanged(rewardedVideoAvailabilityChanged);
    CsIronsourceAd().setRewardedVideoAdStarted(rewardedVideoAdStarted);
    CsIronsourceAd().setRewardedVideoAdEnded(rewardedVideoAdEnded);
    CsIronsourceAd().setRewardedVideoAdRewarded(rewardedVideoAdRewarded);
    CsIronsourceAd().setRewardedVideoAdShowFailed(rewardedVideoAdShowFailed);
    CsIronsourceAd().setRewardedVideoAdClicked(rewardedVideoAdClicked);

    CsIronsourceAd().setInterstitialAdReady(interstitialAdReady);
    CsIronsourceAd().setInterstitialAdLoadFailed(interstitialAdLoadFailed);
    CsIronsourceAd().setInterstitialAdOpened(interstitialAdOpened);
    CsIronsourceAd().setInterstitialAdClosed(interstitialAdClosed);
    CsIronsourceAd().setInterstitialAdShowSucceeded(interstitialAdShowSucceeded);
    CsIronsourceAd().setInterstitialAdShowFailed(interstitialAdShowFailed);
    CsIronsourceAd().setInterstitialAdClicked(interstitialAdClicked);

    CsIronsourceAd().initSDK(appKey: "appKey");
    CsIronsourceAd().setUserId(userId: "userId");
  }

  void offerwallAvailable(bool isAvailable) {
    log("offerwallAvailable:" + isAvailable.toString());
  }

  void offerwallOpened() {
    log("offerwallAvailable");
  }

  void offerwallShowFailed(int code) {
    log("offerwallShowFailed:" + code.toString());
  }

  void offerwallAdCredited(int credits, int totalCredits, bool totalCreditsFlag) {
    log("offerwallAdCredited:" + credits.toString() + ", totalCredits:" + totalCredits.toString() + ", totalCreditsFlag:" + totalCreditsFlag.toString());
  }

  void getOfferwallCreditsFailed(int code) {
    log("getOfferwallCreditsFailed:" + code.toString());
  }

  void offerwallClosed() {
    log("offerwallClosed");
  }

  void rewardedVideoAdOpened() {
    log("RewardedVideoAdOpened");
  }

  void rewardedVideoAdClosed() {
    log("RewardedVideoAdClosed");
  }

  void rewardedVideoAvailabilityChanged(bool isAvailable) {
    log("RewardedVideoAvailabilityChanged:" + isAvailable.toString());
  }

  void rewardedVideoAdStarted() {
    log("RewardedVideoAdStarted");
  }

  void rewardedVideoAdEnded() {
    log("RewardedVideoAdEnded");
  }

  void rewardedVideoAdRewarded(String rewardName, int rewardAmount) {
    log("RewardedVideoAdRewarded:" + rewardName + ", rewardAmount:" + rewardAmount.toString());
  }

  void rewardedVideoAdShowFailed(int code) {
    log("RewardedVideoAdShowFailed:" + code.toString());
  }

  void rewardedVideoAdClicked(String rewardName, int rewardAmount) {
    log("RewardedVideoAdClicked:" + rewardName + ", rewardAmount:" + rewardAmount.toString());
  }

  void interstitialAdReady() {
    log("InterstitialAdReady");
  }

  void interstitialAdLoadFailed(int code) {
    log("InterstitialAdLoadFailed:" + code.toString());
  }

  void interstitialAdOpened() {
    log("InterstitialAdOpened");
  }

  void interstitialAdClosed() {
    log("InterstitialAdClosed");
  }

  void interstitialAdShowSucceeded() {
    log("InterstitialAdShowSucceeded");
  }

  void interstitialAdShowFailed(int code) {
    log("InterstitialAdShowFailed:" + code.toString());
  }

  void interstitialAdClicked() {
    log("InterstitialAdClicked");
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: const Center(
          child: Text('Running on: 123'),
        ),
      ),
    );
  }
}
2
likes
0
points
22
downloads

Publisher

unverified uploader

Weekly Downloads

Ironsource adware

License

unknown (license)

Dependencies

flutter

More

Packages that depend on cs_ironsource_ad