Skip to content

Commit

Permalink
Updated UI for app open ad to include instructions to see ad (#1163)
Browse files Browse the repository at this point in the history
* Updated UI for app open ad to include instructions to see ad

* Update main.dart

---------

Co-authored-by: Justin Malandruccolo <[email protected]>
  • Loading branch information
malandr2 and Justin Malandruccolo authored Aug 29, 2024
1 parent f8e74ca commit e60f69e
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions samples/admob/app_open_example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ class _HomePageState extends State<HomePage> {
final _appOpenAdManager = AppOpenAdManager();
var _isMobileAdsInitializeCalled = false;
var _isPrivacyOptionsRequired = false;
int _counter = 0;
late AppLifecycleReactor _appLifecycleReactor;

@override
Expand Down Expand Up @@ -82,38 +81,23 @@ class _HomePageState extends State<HomePage> {
_initializeMobileAdsSDK();
}

void _incrementCounter() {
setState(() {
_counter++;
});
}

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('App Open Demo Home Page'),
actions: _appBarActions(),
),
body: Center(
body: const Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
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.
);
}

Expand Down

0 comments on commit e60f69e

Please sign in to comment.