adiscope_flutter_plugin 0.0.3 copy "adiscope_flutter_plugin: ^0.0.3" to clipboard
adiscope_flutter_plugin: ^0.0.3 copied to clipboard

Adiscope SDK for Flutter plugin project.

example/lib/main.dart

import 'dart:io';

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

import 'package:flutter/services.dart';
import 'package:adiscope_flutter_plugin/adiscope_flutter_plugin.dart';

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

class MyApp extends StatefulWidget {
  const MyApp({super.key});

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

class _MyAppState extends State<MyApp> {
  var logCount = 0;
  var mediaId;
  var mediaSecret;
  var userId;
  var offerwallId;
  var offerwallDetailUrl;
  var rvUnitId;
  var itUnitId;
  var riUnitId1;
  var riUnitId2;
  var riUnitId3;
  var riUnitId4;
  var riUnitId5;

  final _adiscopeFlutterPlugin = AdiscopeFlutterPlugin();
  final _mediaIdController = new TextEditingController();
  final _userIdController = new TextEditingController();
  final _callbackTagController = new TextEditingController();
  final _childYNController = new TextEditingController();
  final _unitIdController = new TextEditingController();
  final _offerwallUnitIdController = new TextEditingController();
  final _offerwallItemIdController = new TextEditingController();
  final _rvUnitIdController = new TextEditingController();
  final _itUnitIdController = new TextEditingController();
  final _riUnitIdController = new TextEditingController();
  final _riUnitId1Controller = new TextEditingController();
  final _riUnitId2Controller = new TextEditingController();
  final _riUnitId3Controller = new TextEditingController();
  final _riUnitId4Controller = new TextEditingController();
  final _riUnitId5Controller = new TextEditingController();
  String _logResult = "";

  @override
  void initState() {
    super.initState();

    userId = "Flutter_Tester_User";
    if (Platform.isAndroid) {
      mediaId = "23";
      mediaSecret = "5b017706d3a145d9a87c1178560114e6";
      offerwallId = "OFFERWALL";
      rvUnitId = "ADMOB";
      itUnitId = "INTER_TEST";
      riUnitId1 = "RI_TEST";
      riUnitId2 = "RI_TEST1";
      riUnitId3 = "RI_TEST2";
      riUnitId4 = "RI_TEST3";
      riUnitId5 = "RI_TEST4";
    } else if (Platform.isIOS) {
      mediaId = "86";
      mediaSecret = "3f5ae8e75c2d481d9d0f5ea030e544e9";
      offerwallId = "API_OFFERWALL";
      rvUnitId = "ADMOB";
      itUnitId = "INTER_TEST";
      riUnitId1 = "RI_TEST_IOS";
      riUnitId2 = "RI_TEST1_IOS";
      riUnitId3 = "RI_TEST2_IOS";
      riUnitId4 = "RI_TEST3_IOS";
      riUnitId5 = "RI_TEST4_IOS";
    }

    _userIdController.text = userId;
    _offerwallUnitIdController.text = offerwallId;
    _rvUnitIdController.text = rvUnitId;
    _itUnitIdController.text = itUnitId;
    _riUnitIdController.text = riUnitId1;
    _riUnitId1Controller.text = riUnitId1;
    _riUnitId2Controller.text = riUnitId2;
    _riUnitId3Controller.text = riUnitId3;
    _riUnitId4Controller.text = riUnitId4;
    _riUnitId5Controller.text = riUnitId5;

    AdiscopeListener.setupOfferwallListener(
        onOfferwallAdOpened: (unitId) {
          pushLog("onOfferwallAdOpened => $unitId");
        },
        onOfferwallAdClosed: (unitId) {
          pushLog("onOfferwallAdClosed => $unitId");
        },
        onOfferwallAdFailedToShow: (unitId, errorDescription, errorXB3TraceID) {
          pushLog("onOfferwallAdOpened => $unitId, $errorDescription, $errorXB3TraceID");
        }
    );

    AdiscopeListener.setupRewardedVideoListener(
        onRewardedVideoAdLoaded: (unitId) {
          pushLog("onRewardedVideoAdLoaded => $unitId");
        },
        onRewardedVideoAdFailedToLoad: (unitId, errorDescription, errorXB3TraceID) {
          pushLog("onRewardedVideoAdFailedToLoad => $unitId, $errorDescription, $errorXB3TraceID");
        },
        onRewardedVideoAdOpened: (unitId) {
          pushLog("onRewardedVideoAdOpened => $unitId");
        },
        onRewardedVideoAdClosed: (unitId) {
          pushLog("onRewardedVideoAdClosed => $unitId");
        },
        onRewarded: (unitId, currencyUnit, amount) {
          pushLog("onRewarded => $unitId, $currencyUnit, $amount");
        },
        onRewardedVideoAdFailedToShow: (unitId, errorDescription, errorXB3TraceID) {
          pushLog("onRewardedVideoAdFailedToShow => $unitId, $errorDescription, $errorXB3TraceID");
        }
    );

    AdiscopeListener.setupInterstitialListener(
        onInterstitialAdLoaded: (unitId) {
          pushLog("onInterstitialAdLoaded => $unitId");
        },
        onInterstitialAdFailedToLoad: (unitId, errorDescription, errorXB3TraceID) {
          pushLog("onInterstitialAdFailedToLoad => $unitId, $errorDescription, $errorXB3TraceID");
        },
        onInterstitialAdOpened: (unitId) {
          pushLog("onInterstitialAdOpened => $unitId");
        },
        onInterstitialAdClosed: (unitId) {
          pushLog("onInterstitialAdClosed => $unitId");
        },
        onInterstitialAdFailedToShow: (unitId, errorDescription, errorXB3TraceID) {
          pushLog("onInterstitialAdFailedToShow => $unitId, $errorDescription, $errorXB3TraceID");
        }
    );

    AdiscopeListener.setupRewardedInterstitialListener(
        onRewardedInterstitialAdSkip: (unitId) {
          pushLog("onRewardedInterstitialAdSkip => $unitId");
        },
        onRewardedInterstitialAdOpened: (unitId) {
          pushLog("onRewardedInterstitialAdOpened => $unitId");
        },
        onRewardedInterstitialAdClosed: (unitId) {
          pushLog("onRewardedInterstitialAdClosed => $unitId");
        },
        onRewardedInterstitialRewarded: (unitId, currencyUnit, amount) {
          pushLog("onRewardedInterstitialRewarded => $unitId, $currencyUnit, $amount");
        },
        onRewardedInterstitialAdFailedToShow: (unitId, errorDescription, errorXB3TraceID) {
          pushLog("onRewardedInterstitialAdFailedToShow => $unitId, $errorDescription, $errorXB3TraceID");
        }
    );
  }

  Future<void> pushLog(String log) async {
    setState(() {
      if (_logResult.isEmpty) {
        _logResult = "$logCount " + log;
      } else {
        _logResult = "$logCount " + log + "\n" + _logResult;
      }
      logCount++;
    });
  }

  Future<void> initialize() async {
    bool result = false;
    try {
      result = await _adiscopeFlutterPlugin.initialize() ?? false;
    } on PlatformException {
      result = false;
    }
    if (!mounted) return;
    pushLog("Initialize => $result");

    if (result && !_userIdController.text.isEmpty) {
      setUserId(_userIdController.text);
    }
  }

  Future<void> initialize1(String callbackTag) async {
    bool result = false;
    try {
      result = await _adiscopeFlutterPlugin.initialize("", "", callbackTag, "") ?? false;
    } on PlatformException {
      result = false;
    }
    if (!mounted) return;
    pushLog("Initialize => $result");

    if (result && !_userIdController.text.isEmpty) {
      setUserId(_userIdController.text);
    }
  }

  Future<void> initialize2(String callbackTag, String childYN) async {
    bool result = false;
    try {
      result = await _adiscopeFlutterPlugin.initialize("", "", callbackTag, childYN) ?? false;
    } on PlatformException {
      result = false;
    }
    if (!mounted) return;
    pushLog("Initialize => $result");

    if (result && !_userIdController.text.isEmpty) {
      setUserId(_userIdController.text);
    }
  }

  Future<void> initialize3(String mediaId, String mediaSecret) async {
    bool result = false;
    try {
      result = await _adiscopeFlutterPlugin.initialize(mediaId, mediaSecret, "", "") ?? false;
    } on PlatformException {
      result = false;
    }
    if (!mounted) return;
    pushLog("Initialize => $result");

    if (result && !_userIdController.text.isEmpty) {
      setUserId(_userIdController.text);
    }
  }

  Future<void> initialize4(String mediaId, String mediaSecret, String callbackTag) async {
    bool result = false;
    try {
      result = await _adiscopeFlutterPlugin.initialize(mediaId, mediaSecret, callbackTag, "") ?? false;
    } on PlatformException {
      result = false;
    }
    if (!mounted) return;
    pushLog("Initialize => $result");

    if (result && !_userIdController.text.isEmpty) {
      setUserId(_userIdController.text);
    }
  }

  Future<void> initialize5(String mediaId, String mediaSecret, String callbackTag, String childYN) async {
    bool result = false;
    try {
      var mediaId1 = "";
      result = await _adiscopeFlutterPlugin.initialize(mediaId, mediaSecret, callbackTag, childYN) ?? false;
    } on PlatformException {
      result = false;
    }
    if (!mounted) return;
    pushLog("Initialize => $result");

    if (result && !_userIdController.text.isEmpty) {
      setUserId(_userIdController.text);
    }
  }

  Future<void> setUserId(String userId) async {
    bool result = false;
    try {
      result = await _adiscopeFlutterPlugin.setUserId(userId) ?? false;
    } on PlatformException {
      result = false;
    }
    if (!mounted) return;
    pushLog("Set User ID => $result / $userId");
  }

  Future<void> isInitialized() async {
    bool result = false;
    try {
      result = await _adiscopeFlutterPlugin.isInitialized() ?? false;
    } on PlatformException {
      result = false;
    }
    if (!mounted) return;
    pushLog("Initialized Flag => $result");
  }

  Future<void> getSDKVersion() async {
    String result = "";
    try {
      result = await _adiscopeFlutterPlugin.getSDKVersion() ?? "";
    } on PlatformException {
      result = "";
    }
    if (!mounted) return;
    pushLog("SDK Version => $result");
  }

  Future<void> getNetworkVersions() async {
    String result = "";
    try {
      result = await _adiscopeFlutterPlugin.getNetworkVersions() ?? "";
    } on PlatformException {
      result = "";
    }
    if (!mounted) return;
    pushLog("Network Versions => $result");
  }

  Future<void> getUnitStatus(String unitId) async {
    if (unitId.isEmpty) {
      pushLog("Not Found UnitID => $unitId");
      return;
    }

    Map result = {};
    try {
      result = await _adiscopeFlutterPlugin.getUnitStatus(unitId) ?? {};
    } on PlatformException {
      result = {};
    }
    if (!mounted) return;
    pushLog("$unitId UnitID Status => $result");
  }

  Future<void> showMaxMediationDebugger() async {
    try {
      await _adiscopeFlutterPlugin.showMaxMediationDebugger();
    } on PlatformException {
    }
    if (!mounted) return;
    pushLog("Show Max Mediation Debugger");
  }

  Future<void> showAdmobMediationDebugger() async {
    try {
      await _adiscopeFlutterPlugin.showAdmobMediationDebugger();
    } on PlatformException {
    }
    if (!mounted) return;
    pushLog("Show Admob Mediation Debugger");
  }

  Future<void> setVolumeOff(isOn) async {
    try {
      await _adiscopeFlutterPlugin.setVolumeOff(isOn);
    } on PlatformException {
    }
    if (!mounted) return;
    if (isOn) {
      pushLog("Ad Sound Off");
    } else {
      pushLog("Ad Sound On");
    }
  }

  Future<void> showOfferwall(String unitId) async {
    if (unitId.isEmpty) {
      pushLog("Not Found UnitID => $unitId");
      return;
    }

    bool result = false;
    try {
      result = await _adiscopeFlutterPlugin.showOfferwall(unitId.toUpperCase()) ?? false;
    } on PlatformException {
      result = false;
    }
    if (!mounted) return;
    pushLog("Show Offerwall => $result");
  }

  Future<void> showOfferwallDetail(String unitId, String itemId) async {
    if (unitId.isEmpty || itemId.isEmpty) {
      pushLog("Not Found UnitID => $unitId, itemID => $itemId");
      return;
    }

    bool result = false;
    try {
      result = await _adiscopeFlutterPlugin.showOfferwallDetail(unitId, itemId) ?? false;
    } on PlatformException {
      result = false;
    }
    if (!mounted) return;
    pushLog("Show Offerwall Detail => $result");
  }

  Future<void> showOfferwallDetailFromUrl(String unitId, String itemId) async {
    if (unitId.isEmpty || itemId.isEmpty) {
      pushLog("Not Found UnitID => $unitId, itemID => $itemId");
      return;
    }

    bool result = false;
    try {
      String url = "https://link.adiscope.com/$mediaId/$unitId/0/$itemId";
      result = await _adiscopeFlutterPlugin.showOfferwallDetailFromUrl(url) ?? false;
    } on PlatformException {
      result = false;
    }
    if (!mounted) return;
    pushLog("Show Offerwall Detail From Url => $result");
  }

  Future<void> rewardedVideoLoad(String unitId) async {
    if (unitId.isEmpty) {
      pushLog("Not Found UnitID => $unitId");
      return;
    }

    bool result = false;
    try {
      result = await _adiscopeFlutterPlugin.rewardedVideoLoad(unitId) ?? false;
    } on PlatformException {
      result = false;
    }
    if (!mounted) return;
    pushLog("Click RewardedVideo Load => $result");
  }

  Future<void> rewardedVideoIsLoad(String unitId) async {
    if (unitId.isEmpty) {
      pushLog("Not Found UnitID => $unitId");
      return;
    }

    bool result = false;
    try {
      result = await _adiscopeFlutterPlugin.rewardedVideoIsLoad(unitId) ?? false;
    } on PlatformException {
      result = false;
    }
    if (!mounted) return;
    pushLog("RewardedVideo IsLoad => $result");
  }

  Future<void> rewardedVideoShow() async {
    bool result = false;
    try {
      result = await _adiscopeFlutterPlugin.rewardedVideoShow() ?? false;
    } on PlatformException {
      result = false;
    }
    if (!mounted) return;
    pushLog("RewardedVideo Show => $result");
  }

  Future<void> interstitialLoad(String unitId) async {
    if (unitId.isEmpty) {
      pushLog("Not Found UnitID => $unitId");
      return;
    }

    bool result = false;
    try {
      result = await _adiscopeFlutterPlugin.interstitialLoad(unitId) ?? false;
    } on PlatformException {
      result = false;
    }
    if (!mounted) return;
    pushLog("Click Interstitial Load => $result");
  }

  Future<void> interstitialIsLoad(String unitId) async {
    if (unitId.isEmpty) {
      pushLog("Not Found UnitID => $unitId");
      return;
    }

    bool result = false;
    try {
      result = await _adiscopeFlutterPlugin.interstitialIsLoad(unitId) ?? false;
    } on PlatformException {
      result = false;
    }
    if (!mounted) return;
    pushLog("Interstitial IsLoad => $result");
  }

  Future<void> interstitialShow() async {
    bool result = false;
    try {
      result = await _adiscopeFlutterPlugin.interstitialShow() ?? false;
    } on PlatformException {
      result = false;
    }
    if (!mounted) return;
    pushLog("Interstitial Show => $result");
  }

  Future<void> getUnitStatusRewardedInterstitial(String unitId) async {
    if (unitId.isEmpty) {
      pushLog("Not Found UnitID => $unitId");
      return;
    }

    Map result = {};
    try {
      result = await _adiscopeFlutterPlugin.getUnitStatusRewardedInterstitial(unitId) ?? {};
    } on PlatformException {
      result = {};
    }
    if (!mounted) return;
    pushLog("RewardedInterstitial Unit Status => $result");
  }

  Future<void> preLoadAllRewardedInterstitial() async {
    bool result = false;
    try {
      result = await _adiscopeFlutterPlugin.preLoadAllRewardedInterstitial() ?? false;
    } on PlatformException {
      result = false;
    }
    if (!mounted) return;
    pushLog("Click PreLoad All RewardedInterstitial => $result");
  }

  Future<void> preLoadRewardedInterstitial(List<String>? unitIds) async {
    bool result = false;
    try {
      result = await _adiscopeFlutterPlugin.preLoadRewardedInterstitial(unitIds) ?? false;
    } on PlatformException {
      result = false;
    }
    if (!mounted) return;
    pushLog("Click PreLoad UnitIDs RewardedInterstitial => $result");
  }

  Future<void> showRewardedInterstitial(String unitId) async {
    bool result = false;
    try {
      result = await _adiscopeFlutterPlugin.showRewardedInterstitial(unitId) ?? false;
    } on PlatformException {
      result = false;
    }
    if (!mounted) return;
    pushLog("RewardedInterstitial Show => $result");
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Adiscope Example App'),
        ),
        body: Center(
            child: Column(
              children: [
                Container(
                  height: 1.0,
                  width: double.infinity,
                  color:Colors.black,
                ),
                SizedBox(
                  width: double.infinity,
                  height: 200,
                  child: Scrollbar(
                    thumbVisibility: true,
                    child: SingleChildScrollView(
                      scrollDirection: Axis.vertical,
                      child: Text('$_logResult'),
                    ),
                  ),
                ),
                Container(
                  height: 1.0,
                  width: double.infinity,
                  color:Colors.black,
                ),
                Expanded(
                  child: SingleChildScrollView(
                    scrollDirection: Axis.vertical,
                    child: Column(
                      children: [
                        SizedBox( height: 20,),
                        Row(
                          children: [
                            Text("Media ID"),
                            Flexible(
                              child: SizedBox(
                                height: 30,
                                child: TextField(
                                  controller: _mediaIdController,
                                  enabled: false,
                                  decoration: InputDecoration(
                                    labelText: mediaId,
                                    border: OutlineInputBorder(), //외곽선
                                  ),
                                ),
                              ),
                            ),
                          ],
                        ),
                        SizedBox( height: 10,),
                        Row(
                          children: [
                            Text("User ID"),
                            Flexible(
                              child: SizedBox(
                                height: 30,
                                child: TextField(
                                  controller: _userIdController,
                                  decoration: InputDecoration(
                                    border: OutlineInputBorder(), //외곽선
                                  ),
                                ),
                              ),
                            ),
                          ],
                        ),
                        SizedBox( height: 10,),
                        Container(
                          width: double.infinity,
                          child: OutlinedButton(
                              onPressed: () { setUserId(_userIdController.text); },
                              child: Text("Set User ID")
                          ),
                        ),
                        SizedBox( height: 20,),
                        Row(
                          children: [
                            Text("Callback Tag"),
                            Flexible(
                              child: SizedBox(
                                height: 30,
                                child: TextField(
                                  controller: _callbackTagController,
                                  decoration: InputDecoration(
                                    border: OutlineInputBorder(), //외곽선
                                  ),
                                ),
                              ),
                            ),
                          ],
                        ),
                        SizedBox( height: 10,),
                        Row(
                          children: [
                            Text("Child YN"),
                            Flexible(
                              child: SizedBox(
                                height: 30,
                                child: TextField(
                                  controller: _childYNController,
                                  decoration: InputDecoration(
                                    border: OutlineInputBorder(), //외곽선
                                  ),
                                ),
                              ),
                            ),
                          ],
                        ),
                        SizedBox( height: 10,),
                        Container(
                          width: double.infinity,
                          child: OutlinedButton(
                              onPressed: () { initialize(); },
                              child: Text("Initializ()")
                          ),
                        ),
                        SizedBox( height: 10,),
                        Container(
                          width: double.infinity,
                          child: OutlinedButton(
                              onPressed: () { initialize1(_callbackTagController.text); },
                              child: Text("Initializ(callbackTag)")
                          ),
                        ),
                        SizedBox( height: 10,),
                        Container(
                          width: double.infinity,
                          child: OutlinedButton(
                              onPressed: () { initialize2(_callbackTagController.text, _childYNController.text); },
                              child: Text("Initializ(callbackTag, childYN)")
                          ),
                        ),
                        SizedBox( height: 10,),
                        Container(
                          width: double.infinity,
                          child: OutlinedButton(
                              onPressed: () {
                                initialize3(mediaId, mediaSecret);
                              },
                              child: Text("Initializ(mediaId, mediaSecret)")
                          ),
                        ),
                        SizedBox( height: 10,),
                        Container(
                          width: double.infinity,
                          child: OutlinedButton(
                              onPressed: () {
                                initialize4(mediaId, mediaSecret, _callbackTagController.text);
                              },
                              child: Text("Initializ(mediaId, mediaSecret, callbackTag)")
                          ),
                        ),
                        SizedBox( height: 10,),
                        Container(
                          width: double.infinity,
                          child: OutlinedButton(
                              onPressed: () {
                                initialize5(mediaId, mediaSecret, _callbackTagController.text, _childYNController.text);
                              },
                              child: Text("Initializ(mediaId, mediaSecret, callbackTag, childYN)")
                          ),
                        ),
                        SizedBox( height: 20,),
                        Container(
                          width: double.infinity,
                          child: OutlinedButton(
                              onPressed: () { isInitialized(); },
                              child: Text("isInitialized")
                          ),
                        ),
                        SizedBox( height: 10,),
                        Container(
                          width: double.infinity,
                          child: OutlinedButton(
                              onPressed: () { getSDKVersion(); },
                              child: Text("Print SDK Version")
                          ),
                        ),
                        SizedBox( height: 10,),
                        Container(
                          width: double.infinity,
                          child: OutlinedButton(
                              onPressed: () { getNetworkVersions(); },
                              child: Text("Print Network Version")
                          ),
                        ),
                        SizedBox( height: 20,),
                        Row(
                          children: [
                            Text("Unit ID"),
                            Flexible(
                              child: SizedBox(
                                height: 30,
                                child: TextField(
                                  controller: _unitIdController,
                                  decoration: InputDecoration(
                                    border: OutlineInputBorder(), //외곽선
                                  ),
                                ),
                              ),
                            ),
                          ],
                        ),
                        SizedBox( height: 10,),
                        Container(
                          width: double.infinity,
                          child: OutlinedButton(
                              onPressed: () { getUnitStatus(_unitIdController.text); },
                              child: Text("Get UnitID Status")
                          ),
                        ),
                        SizedBox( height: 10,),
                        Container(
                          width: double.infinity,
                          child: OutlinedButton(
                              onPressed: () { showMaxMediationDebugger(); },
                              child: Text("Show Max Mediation Debugger - 앱 구동 후 첫 진입 시 5초간 대기 후 화면 터치 가능")
                          ),
                        ),
                        SizedBox( height: 10,),
                        Container(
                          width: double.infinity,
                          child: OutlinedButton(
                              onPressed: () { showAdmobMediationDebugger(); },
                              child: Text("Show Admob Mediation Debugger - 미동작 시 애드몹 물량 로드 후 진입 가능 (이니셜라이즈 필요)")
                          ),
                        ),
                        SizedBox( height: 10,),
                        Container(
                          width: double.infinity,
                          child: OutlinedButton(
                              onPressed: () { setVolumeOff(false); },
                              child: Text("Ad Sound On")
                          ),
                        ),
                        SizedBox( height: 10,),
                        Container(
                          width: double.infinity,
                          child: OutlinedButton(
                              onPressed: () { setVolumeOff(true); },
                              child: Text("Ad Sound Off")
                          ),
                        ),
                        SizedBox( height: 20,),
                        Text(
                          "Offerwall",
                          style: TextStyle(
                            fontWeight: FontWeight.bold,
                            color: Colors.blue,
                          ),
                        ),
                        SizedBox( height: 10,),
                        Row(
                          children: [
                            Text("Offerwall"),
                            Flexible(
                              child: SizedBox(
                                height: 30,
                                child: TextField(
                                  controller: _offerwallUnitIdController,
                                  decoration: InputDecoration(
                                    border: OutlineInputBorder(), //외곽선
                                  ),
                                ),
                              ),
                            ),
                          ],
                        ),
                        SizedBox( height: 10,),
                        Container(
                          width: double.infinity,
                          child: OutlinedButton(
                              onPressed: () { showOfferwall(_offerwallUnitIdController.text); },
                              child: Text("Show Offerwall")
                          ),
                        ),
                        SizedBox( height: 10,),
                        Row(
                          children: [
                            Text("Offerwall Detail Id"),
                            Flexible(
                              child: SizedBox(
                                height: 30,
                                child: TextField(
                                  controller: _offerwallItemIdController,
                                  decoration: InputDecoration(
                                    border: OutlineInputBorder(), //외곽선
                                  ),
                                ),
                              ),
                            ),
                          ],
                        ),
                        SizedBox( height: 10,),
                        Container(
                          width: double.infinity,
                          child: OutlinedButton(
                              onPressed: () { showOfferwallDetail(_offerwallUnitIdController.text, _offerwallItemIdController.text); },
                              child: Text("Show Offerwall Detail")
                          ),
                        ),
                        SizedBox( height: 10,),
                        Container(
                          width: double.infinity,
                          child: OutlinedButton(
                              onPressed: () { showOfferwallDetailFromUrl(_offerwallUnitIdController.text, _offerwallItemIdController.text); },
                              child: Text("Show Offerwall Detail From URL")
                          ),
                        ),
                        SizedBox( height: 20,),
                        Text(
                          "Rewarded Video",
                          style: TextStyle(
                            fontWeight: FontWeight.bold,
                            color: Colors.blue,
                          ),
                        ),
                        SizedBox( height: 10,),
                        Row(
                          children: [
                            Text("Rewarded Unit Id"),
                            Flexible(
                              child: SizedBox(
                                height: 30,
                                child: TextField(
                                  controller: _rvUnitIdController,
                                  decoration: InputDecoration(
                                    border: OutlineInputBorder(), //외곽선
                                  ),
                                ),
                              ),
                            ),
                          ],
                        ),
                        SizedBox( height: 10,),
                        Container(
                          width: double.infinity,
                          child: OutlinedButton(
                              onPressed: () { rewardedVideoLoad(_rvUnitIdController.text); },
                              child: Text("RewardedVideo - Load")
                          ),
                        ),
                        SizedBox( height: 10,),
                        Container(
                          width: double.infinity,
                          child: OutlinedButton(
                              onPressed: () { rewardedVideoIsLoad(_rvUnitIdController.text); },
                              child: Text("RewardedVideo - IsLoaded")
                          ),
                        ),
                        SizedBox( height: 10,),
                        Container(
                          width: double.infinity,
                          child: OutlinedButton(
                              onPressed: () { rewardedVideoShow(); },
                              child: Text("RewardedVideo - Show")
                          ),
                        ),
                        SizedBox( height: 20,),
                        Text(
                          "Interstitial",
                          style: TextStyle(
                            fontWeight: FontWeight.bold,
                            color: Colors.blue,
                          ),
                        ),
                        SizedBox( height: 10,),
                        Row(
                          children: [
                            Text("Interstitial Unit Id"),
                            Flexible(
                              child: SizedBox(
                                height: 30,
                                child: TextField(
                                  controller: _itUnitIdController,
                                  decoration: InputDecoration(
                                    border: OutlineInputBorder(), //외곽선
                                  ),
                                ),
                              ),
                            ),
                          ],
                        ),
                        SizedBox( height: 10,),
                        Container(
                          width: double.infinity,
                          child: OutlinedButton(
                              onPressed: () { interstitialLoad(_itUnitIdController.text); },
                              child: Text("Interstitial - Load")
                          ),
                        ),
                        SizedBox( height: 10,),
                        Container(
                          width: double.infinity,
                          child: OutlinedButton(
                              onPressed: () { interstitialIsLoad(_itUnitIdController.text); },
                              child: Text("Interstitial - IsLoaded")
                          ),
                        ),
                        SizedBox( height: 10,),
                        Container(
                          width: double.infinity,
                          child: OutlinedButton(
                              onPressed: () { interstitialShow(); },
                              child: Text("Interstitial - Show")
                          ),
                        ),
                        SizedBox( height: 20,),
                        Text(
                          "RewardedVideo Interstitial",
                          style: TextStyle(
                            fontWeight: FontWeight.bold,
                            color: Colors.blue,
                          ),
                        ),
                        SizedBox( height: 10,),
                        Container(
                          width: double.infinity,
                          child: OutlinedButton(
                              onPressed: () { preLoadAllRewardedInterstitial(); },
                              child: Text("RewardedVideo Interstitial - PreLoad All")
                          ),
                        ),
                        SizedBox( height: 10,),
                        Row(
                          children: [
                            Text("RV It Unit Id1"),
                            Flexible(
                              child: SizedBox(
                                height: 30,
                                child: TextField(
                                  controller: _riUnitId1Controller,
                                  decoration: InputDecoration(
                                    border: OutlineInputBorder(), //외곽선
                                  ),
                                ),
                              ),
                            ),
                          ],
                        ),
                        SizedBox( height: 10,),
                        Row(
                          children: [
                            Text("RV It Unit Id2"),
                            Flexible(
                              child: SizedBox(
                                height: 30,
                                child: TextField(
                                  controller: _riUnitId2Controller,
                                  decoration: InputDecoration(
                                    border: OutlineInputBorder(), //외곽선
                                  ),
                                ),
                              ),
                            ),
                          ],
                        ),
                        SizedBox( height: 10,),
                        Row(
                          children: [
                            Text("RV It Unit Id3"),
                            Flexible(
                              child: SizedBox(
                                height: 30,
                                child: TextField(
                                  controller: _riUnitId3Controller,
                                  decoration: InputDecoration(
                                    border: OutlineInputBorder(), //외곽선
                                  ),
                                ),
                              ),
                            ),
                          ],
                        ),
                        SizedBox( height: 10,),
                        Row(
                          children: [
                            Text("RV It Unit Id4"),
                            Flexible(
                              child: SizedBox(
                                height: 30,
                                child: TextField(
                                  controller: _riUnitId4Controller,
                                  decoration: InputDecoration(
                                    border: OutlineInputBorder(), //외곽선
                                  ),
                                ),
                              ),
                            ),
                          ],
                        ),
                        SizedBox( height: 10,),
                        Row(
                          children: [
                            Text("RV It Unit Id5"),
                            Flexible(
                              child: SizedBox(
                                height: 30,
                                child: TextField(
                                  controller: _riUnitId5Controller,
                                  decoration: InputDecoration(
                                    border: OutlineInputBorder(), //외곽선
                                  ),
                                ),
                              ),
                            ),
                          ],
                        ),
                        SizedBox( height: 10,),
                        Container(
                          width: double.infinity,
                          child: OutlinedButton(
                              onPressed: () {
                                var item = List<String>.empty(growable : true);
                                if (_riUnitId1Controller.text.isNotEmpty) {
                                  item.add(_riUnitId1Controller.text);
                                }
                                if (_riUnitId2Controller.text.isNotEmpty) {
                                  item.add(_riUnitId2Controller.text);
                                }
                                if (_riUnitId3Controller.text.isNotEmpty) {
                                  item.add(_riUnitId3Controller.text);
                                }
                                if (_riUnitId4Controller.text.isNotEmpty) {
                                  item.add(_riUnitId4Controller.text);
                                }
                                if (_riUnitId5Controller.text.isNotEmpty) {
                                  item.add(_riUnitId5Controller.text);
                                }
                                preLoadRewardedInterstitial(item.cast<String>());
                              },
                              child: Text("RewardedVideo Interstitial - PreLoad UnitIDs")
                          ),
                        ),
                        SizedBox( height: 10,),
                        Row(
                          children: [
                            Text("RV It Unit Id"),
                            Flexible(
                              child: SizedBox(
                                height: 30,
                                child: TextField(
                                  controller: _riUnitIdController,
                                  decoration: InputDecoration(
                                    border: OutlineInputBorder(), //외곽선
                                  ),
                                ),
                              ),
                            ),
                          ],
                        ),
                        SizedBox( height: 10,),
                        Container(
                          width: double.infinity,
                          child: OutlinedButton(
                              onPressed: () { showRewardedInterstitial(_riUnitIdController.text); },
                              child: Text("RewardedVideo Interstitial - Show")
                          ),
                        ),
                        SizedBox( height: 10,),
                        Container(
                          width: double.infinity,
                          child: OutlinedButton(
                              onPressed: () { getUnitStatusRewardedInterstitial(_riUnitIdController.text); },
                              child: Text("RewardedVideo Interstitial - GetUnitStatus")
                          ),
                        ),
                        SizedBox( height: 30,),
                      ],
                    ),
                  ),
                )
              ],
            )
        ),
      ),
    );
  }
}
1
likes
0
points
189
downloads

Publisher

unverified uploader

Weekly Downloads

Adiscope SDK for Flutter plugin project.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on adiscope_flutter_plugin