Skip to content

Commit 936b140

Browse files
committed
Format fix
1 parent 82b0930 commit 936b140

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+3245
-2871
lines changed

packages/google_mobile_ads/example/lib/anchored_adaptive_example.dart

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ class _AnchoredAdaptiveExampleState extends State<AnchoredAdaptiveExample> {
5252

5353
final AnchoredAdaptiveBannerAdSize? size =
5454
await AdSize.getCurrentOrientationAnchoredAdaptiveBannerAdSize(
55-
MediaQuery.of(context).size.width.truncate());
55+
MediaQuery.of(context).size.width.truncate(),
56+
);
5657

5758
if (size == null) {
5859
print('Unable to get height of anchored banner.');
@@ -113,30 +114,29 @@ class _AnchoredAdaptiveExampleState extends State<AnchoredAdaptiveExample> {
113114

114115
@override
115116
Widget build(BuildContext context) => Scaffold(
116-
appBar: AppBar(
117-
title: Text('Anchored adaptive banner example'),
118-
),
119-
body: Center(
120-
child: Stack(
121-
alignment: AlignmentDirectional.bottomCenter,
122-
children: <Widget>[
123-
ListView.separated(
124-
padding: const EdgeInsets.symmetric(horizontal: 16.0),
125-
itemBuilder: (context, index) {
126-
return Text(
127-
Constants.placeholderText,
128-
style: TextStyle(fontSize: 24),
129-
);
130-
},
131-
separatorBuilder: (context, index) {
132-
return Container(height: 40);
133-
},
134-
itemCount: 5),
135-
_getAdWidget(),
136-
],
117+
appBar: AppBar(title: Text('Anchored adaptive banner example')),
118+
body: Center(
119+
child: Stack(
120+
alignment: AlignmentDirectional.bottomCenter,
121+
children: <Widget>[
122+
ListView.separated(
123+
padding: const EdgeInsets.symmetric(horizontal: 16.0),
124+
itemBuilder: (context, index) {
125+
return Text(
126+
Constants.placeholderText,
127+
style: TextStyle(fontSize: 24),
128+
);
129+
},
130+
separatorBuilder: (context, index) {
131+
return Container(height: 40);
132+
},
133+
itemCount: 5,
137134
),
138-
),
139-
);
135+
_getAdWidget(),
136+
],
137+
),
138+
),
139+
);
140140

141141
@override
142142
void dispose() {

packages/google_mobile_ads/example/lib/fluid_example.dart

Lines changed: 39 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -30,53 +30,48 @@ class _FluidExampleExampleState extends State<FluidExample> {
3030

3131
@override
3232
Widget build(BuildContext context) => Scaffold(
33-
appBar: AppBar(
34-
title: Text('Fluid example'),
35-
),
36-
body: Center(
37-
child: Padding(
38-
padding: const EdgeInsets.symmetric(horizontal: 16.0),
39-
child: ListView.separated(
40-
itemCount: 3,
41-
separatorBuilder: (BuildContext context, int index) {
42-
return Container(
43-
height: 40,
33+
appBar: AppBar(title: Text('Fluid example')),
34+
body: Center(
35+
child: Padding(
36+
padding: const EdgeInsets.symmetric(horizontal: 16.0),
37+
child: ListView.separated(
38+
itemCount: 3,
39+
separatorBuilder: (BuildContext context, int index) {
40+
return Container(height: 40);
41+
},
42+
itemBuilder: (BuildContext context, int index) {
43+
if (index == 1) {
44+
return Align(
45+
alignment: Alignment.center,
46+
child: FluidAdWidget(width: _width, ad: _fluidAd!),
4447
);
45-
},
46-
itemBuilder: (BuildContext context, int index) {
47-
if (index == 1) {
48-
return Align(
49-
alignment: Alignment.center,
50-
child: FluidAdWidget(
51-
width: _width,
52-
ad: _fluidAd!,
53-
),
54-
);
55-
} else if (index == 2) {
56-
return ElevatedButton(
57-
onPressed: () {
58-
double newWidth;
59-
if (_width == 200.0) {
60-
newWidth = 100.0;
61-
} else if (_width == 100.0) {
62-
newWidth = 150.0;
63-
} else {
64-
newWidth = 200.0;
65-
}
66-
setState(() {
67-
_width = newWidth;
68-
});
69-
},
70-
child: Text('Change size'));
71-
}
72-
return Text(
73-
Constants.placeholderText,
74-
style: TextStyle(fontSize: 24),
48+
} else if (index == 2) {
49+
return ElevatedButton(
50+
onPressed: () {
51+
double newWidth;
52+
if (_width == 200.0) {
53+
newWidth = 100.0;
54+
} else if (_width == 100.0) {
55+
newWidth = 150.0;
56+
} else {
57+
newWidth = 200.0;
58+
}
59+
setState(() {
60+
_width = newWidth;
61+
});
62+
},
63+
child: Text('Change size'),
7564
);
76-
},
77-
),
65+
}
66+
return Text(
67+
Constants.placeholderText,
68+
style: TextStyle(fontSize: 24),
69+
);
70+
},
7871
),
79-
));
72+
),
73+
),
74+
);
8075

8176
@override
8277
void didChangeDependencies() {

packages/google_mobile_ads/example/lib/inline_adaptive_example.dart

Lines changed: 28 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ class _InlineAdaptiveExampleState extends State<InlineAdaptiveExample> {
5454

5555
// Get an inline adaptive size for the current orientation.
5656
AdSize size = AdSize.getCurrentOrientationInlineAdaptiveBannerAdSize(
57-
_adWidth.truncate());
57+
_adWidth.truncate(),
58+
);
5859

5960
_inlineAdaptiveAd = AdManagerBannerAd(
6061
adUnitId: Platform.isAndroid
@@ -103,13 +104,12 @@ class _InlineAdaptiveExampleState extends State<InlineAdaptiveExample> {
103104
_isLoaded &&
104105
_adSize != null) {
105106
return Align(
106-
child: Container(
107-
width: _adWidth,
108-
height: _adSize!.height.toDouble(),
109-
child: AdWidget(
110-
ad: _inlineAdaptiveAd!,
107+
child: Container(
108+
width: _adWidth,
109+
height: _adSize!.height.toDouble(),
110+
child: AdWidget(ad: _inlineAdaptiveAd!),
111111
),
112-
));
112+
);
113113
}
114114
// Reload the ad if the orientation changes.
115115
if (_currentOrientation != orientation) {
@@ -123,31 +123,28 @@ class _InlineAdaptiveExampleState extends State<InlineAdaptiveExample> {
123123

124124
@override
125125
Widget build(BuildContext context) => Scaffold(
126-
appBar: AppBar(
127-
title: Text('Inline adaptive banner example'),
128-
),
129-
body: Center(
130-
child: Padding(
131-
padding: const EdgeInsets.symmetric(horizontal: _insets),
132-
child: ListView.separated(
133-
itemCount: 3,
134-
separatorBuilder: (BuildContext context, int index) {
135-
return Container(
136-
height: 40,
137-
);
138-
},
139-
itemBuilder: (BuildContext context, int index) {
140-
if (index == 1) {
141-
return _getAdWidget();
142-
}
143-
return Text(
144-
Constants.placeholderText,
145-
style: TextStyle(fontSize: 24),
146-
);
147-
},
148-
),
126+
appBar: AppBar(title: Text('Inline adaptive banner example')),
127+
body: Center(
128+
child: Padding(
129+
padding: const EdgeInsets.symmetric(horizontal: _insets),
130+
child: ListView.separated(
131+
itemCount: 3,
132+
separatorBuilder: (BuildContext context, int index) {
133+
return Container(height: 40);
134+
},
135+
itemBuilder: (BuildContext context, int index) {
136+
if (index == 1) {
137+
return _getAdWidget();
138+
}
139+
return Text(
140+
Constants.placeholderText,
141+
style: TextStyle(fontSize: 24),
142+
);
143+
},
149144
),
150-
));
145+
),
146+
),
147+
);
151148

152149
@override
153150
void dispose() {

0 commit comments

Comments
 (0)