Skip to content

Commit

Permalink
Update mediaQuery API in adaptive banner sample (#938)
Browse files Browse the repository at this point in the history
added MediaQuery.sizeOf(context).width.truncate() instead of   MediaQuery.of(context).size.width.truncate()
  • Loading branch information
ishworpanta10 authored Oct 25, 2023
1 parent 9a04cef commit 6f329ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion samples/admob/adaptive_banner_example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class AdaptiveBannerExampleState extends State<AdaptiveBannerExample> {
void _loadAd() async {
// Get an AnchoredAdaptiveBannerAdSize before loading the ad.
final size = await AdSize.getCurrentOrientationAnchoredAdaptiveBannerAdSize(
MediaQuery.of(context).size.width.truncate());
MediaQuery.sizeOf(context).width.truncate());

if (size == null) {
// Unable to get width of anchored banner.
Expand Down

0 comments on commit 6f329ad

Please sign in to comment.