diff --git a/samples/admob/adaptive_banner_example/lib/main.dart b/samples/admob/adaptive_banner_example/lib/main.dart index 6f5ce5a22..f8956c6e8 100644 --- a/samples/admob/adaptive_banner_example/lib/main.dart +++ b/samples/admob/adaptive_banner_example/lib/main.dart @@ -83,7 +83,7 @@ class AdaptiveBannerExampleState extends State { 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.