pangle_global_flutter 0.1.2 pangle_global_flutter: ^0.1.2 copied to clipboard
Pangle global for flutter.(Beta)
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:pangle_global_flutter/ad_containers.dart';
import 'package:pangle_global_flutter/ad_listeners.dart';
import 'package:pangle_global_flutter/pangle_global_flutter.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
void initState() {
super.initState();
PangleGlobalFlutter.instance.initialize("8025677");
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
body: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
ElevatedButton(
onPressed: () {
PAGInterstitialAd.load(
adUnitId: "980088188",
adLoadCallback: PAGInterstitialAdLoadListener(
onError: (code, message) {},
onAdLoaded: (ad) {
ad.show();
}));
},
child: const Text('Run PAGInterstitialAd')),
ElevatedButton(
onPressed: () {
PAGAppOpenAd.load(
adUnitId: "890000078",
adLoadCallback: PAGAppOpenAdLoadListener(
onError: (code, message) {},
onAdLoaded: (ad) {
ad.show();
}));
},
child: const Text('Run PAGAppOpenAd')),
],
),
),
),
);
}
}