loadAdaptive method

Future<bool> loadAdaptive({
  1. required double screenWidth,
  2. bool collapsible = false,
})

Load an adaptive banner. Must be called with screen width.

Implementation

Future<bool> loadAdaptive({
  required double screenWidth,
  bool collapsible = false,
}) async {
  if (state == AdState.loading) return false;

  final size = await AdSize.getLargeAnchoredAdaptiveBannerAdSize(
    screenWidth.truncate(),
  );
  if (size == null) return false;

  _adSize = size;
  return _loadWithSize(size, collapsible: collapsible);
}