consoliadsplugin 0.0.1
consoliadsplugin: ^0.0.1 copied to clipboard
ConsoliAdsSdk Plugin
import 'package:flutter/material.dart';
import 'dart:async';
import 'package:license/license.dart';
import 'package:flutter/services.dart';
import 'package:consoliadsplugin/consoliadsplugin.dart';
void main() {
final licenseData = LicenseData(copyrightHolderName: 'Consoliads');
print(mit(licenseData));
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();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('ConsoliAds Plugin'),
),
body: Center(
child: Column(
// Column is also a layout widget. It takes a list of children and
// arranges them vertically. By default, it sizes itself to fit its
// children horizontally, and tries to be as tall as its parent.
//
// Invoke "debug painting" (press "p" in the console, choose the
// "Toggle Debug Paint" action from the Flutter Inspector in Android
// Studio, or the "Toggle Debug Paint" command in Visual Studio Code)
// to see the wireframe for each widget.
//
// Column has various properties to control how it sizes itself and
// how it positions its children. Here we use mainAxisAlignment to
// center the children vertically; the main axis here is the vertical
// axis because Columns are vertical (the cross axis would be
// horizontal).
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
ElevatedButton(
child: Text('Int Consoliads'),
onPressed: initConsoliAdsSdk,
),
ElevatedButton(
child: Text('Load Interstitial'),
onPressed: loadInterstitial,
),
ElevatedButton(
child: Text('Show Interstitial'),
onPressed: showInterstitial,
),
],
),
),
),
);
}
void initConsoliAdsSdk() {
ConsoliAdsPlugin.initSDK(true, true, "567f2188d5d283f6fa4fccec99dc6677");
}
void loadInterstitial() {
ConsoliAdsPlugin.loadInterstitial();
}
void showInterstitial() {
ConsoliAdsPlugin.showInterstitial();
}
}