From e60f69ed791a6e184f0cfa33d4216d573710bfac Mon Sep 17 00:00:00 2001 From: Justin Malandruccolo Date: Thu, 29 Aug 2024 12:36:53 -0400 Subject: [PATCH] Updated UI for app open ad to include instructions to see ad (#1163) * Updated UI for app open ad to include instructions to see ad * Update main.dart --------- Co-authored-by: Justin Malandruccolo --- samples/admob/app_open_example/lib/main.dart | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/samples/admob/app_open_example/lib/main.dart b/samples/admob/app_open_example/lib/main.dart index ec3fabe5f..8112bcee2 100644 --- a/samples/admob/app_open_example/lib/main.dart +++ b/samples/admob/app_open_example/lib/main.dart @@ -53,7 +53,6 @@ class _HomePageState extends State { final _appOpenAdManager = AppOpenAdManager(); var _isMobileAdsInitializeCalled = false; var _isPrivacyOptionsRequired = false; - int _counter = 0; late AppLifecycleReactor _appLifecycleReactor; @override @@ -82,12 +81,6 @@ class _HomePageState extends State { _initializeMobileAdsSDK(); } - void _incrementCounter() { - setState(() { - _counter++; - }); - } - @override Widget build(BuildContext context) { return Scaffold( @@ -95,25 +88,16 @@ class _HomePageState extends State { title: const Text('App Open Demo Home Page'), actions: _appBarActions(), ), - body: Center( + body: const Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - const Text( - 'You have pushed the button this many times:', - ), Text( - '$_counter', - style: Theme.of(context).textTheme.headlineMedium, + 'Leave and switch back to the app to see the ad.', ), ], ), ), - floatingActionButton: FloatingActionButton( - onPressed: _incrementCounter, - tooltip: 'Increment', - child: const Icon(Icons.add), - ), // This trailing comma makes auto-formatting nicer for build methods. ); }