This commit is contained in:
2025-02-23 22:18:01 +01:00
parent 38e9908533
commit c31e275dae
3 changed files with 199 additions and 171 deletions

View File

@@ -15,7 +15,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());
}
@@ -38,6 +43,7 @@ class EditProfile extends StatefulWidget {
class _EditProfileState extends State<EditProfile>
with ShowAlertDialog, ShowEventDialog {
BannerAd? _bannerAd;
TextEditingController inputUserName = TextEditingController();
TextEditingController inputName = TextEditingController();
@@ -192,6 +198,11 @@ class _EditProfileState extends State<EditProfile>
@override
void initState() {
super.initState();
AdHelper.createBannerAd(() => setState(() {})).then((ad) {
setState(() {
_bannerAd = ad;
});
});
_getInfoProfile();
}
@@ -215,6 +226,12 @@ class _EditProfileState extends State<EditProfile>
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(
left: 15.0, right: 15.0, top: 15, bottom: 0),