gns_flutter_plugin 0.0.2
gns_flutter_plugin: ^0.0.2 copied to clipboard
Geniee SDK for Flutter platform
example/lib/main.dart
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:gns_flutter_plugin/gns_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> {
@override
void initState() {
super.initState();
initPlatformState();
}
// Platform messages are asynchronous, so we initialize in an async method.
Future<void> initPlatformState() async {}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
body: Center(
child: Column(
children: [
Card(
child: SizedBox(
width: 300,
height: 250,
child: GNBannerAdWidget(
zoneId: "1530754",
onReceiveAd: (String zoneId) {
print("LongUni onReceiveAd flutter: $zoneId");
},
onFailedToReceiveAd: (String zoneId) {
print("LongUni onFailedToReceiveAd flutter: $zoneId");
},
),
),
),
Card(
child: SizedBox(
width: 300,
height: 250,
child: GNBannerAdWidget(
zoneId: "1292558",
onReceiveAd: (String zoneId) {
print("LongUni onReceiveAd flutter: $zoneId");
},
onFailedToReceiveAd: (String zoneId) {
print("LongUni onFailedToReceiveAd flutter: $zoneId");
},
),
),
),
],
)),
),
);
}
}