add pub in update event
This commit is contained in:
@@ -16,7 +16,12 @@ import '../classes/eventAdded.dart';
|
||||
|
||||
import '../variable/globals.dart' as globals;
|
||||
|
||||
void main() {
|
||||
import '../classes/ad_helper.dart';
|
||||
import 'package:google_mobile_ads/google_mobile_ads.dart';
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
await MobileAds.instance.initialize();
|
||||
runApp(MyApp());
|
||||
}
|
||||
|
||||
@@ -45,6 +50,8 @@ class UpdateeventImage extends StatefulWidget {
|
||||
|
||||
class _UpdateeventImageState extends State<UpdateeventImage>
|
||||
with ShowAlertDialog, ShowEventDialog {
|
||||
BannerAd? _bannerAd;
|
||||
|
||||
TextEditingController inputName = TextEditingController();
|
||||
|
||||
TextEditingController inputDate = TextEditingController();
|
||||
@@ -308,8 +315,13 @@ class _UpdateeventImageState extends State<UpdateeventImage>
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
start();
|
||||
super.initState();
|
||||
AdHelper.createBannerAd(() => setState(() {})).then((ad) {
|
||||
setState(() {
|
||||
_bannerAd = ad;
|
||||
});
|
||||
});
|
||||
start();
|
||||
}
|
||||
|
||||
final _formKey = GlobalKey<FormState>();
|
||||
@@ -426,6 +438,12 @@ class _UpdateeventImageState extends State<UpdateeventImage>
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
_bannerAd == null
|
||||
? SizedBox.shrink()
|
||||
: SizedBox(
|
||||
height: _bannerAd!.size.height.toDouble(),
|
||||
width: _bannerAd!.size.width.toDouble(),
|
||||
child: AdWidget(ad: _bannerAd!)),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 60.0),
|
||||
child: Center(
|
||||
|
Reference in New Issue
Block a user