add pub
This commit is contained in:
@@ -11,7 +11,12 @@ import '../classes/alert.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());
|
||||
}
|
||||
|
||||
@@ -33,6 +38,8 @@ class AddProfile extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _AddProfileState extends State<AddProfile> with ShowAlertDialog {
|
||||
BannerAd? _bannerAd;
|
||||
|
||||
TextEditingController inputUserName = TextEditingController();
|
||||
|
||||
TextEditingController inputName = TextEditingController();
|
||||
@@ -133,6 +140,11 @@ class _AddProfileState extends State<AddProfile> with ShowAlertDialog {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
AdHelper.createBannerAd(() => setState(() {})).then((ad) {
|
||||
setState(() {
|
||||
_bannerAd = ad;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
final _formKey = GlobalKey<FormState>();
|
||||
@@ -154,6 +166,12 @@ class _AddProfileState extends State<AddProfile> with ShowAlertDialog {
|
||||
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),
|
||||
|
Reference in New Issue
Block a user