AdSize.getInlineBanner constructor

AdSize.getInlineBanner(
  1. int width,
  2. int maxHeight
)

Inline banner ads have a desired width and a maximum height, useful when you want to limit the banner's height. Inline banners are larger and taller compared to adaptive banners. They have variable height, including Medium Rectangle size, and can be as tall as the device screen.

Width of the current device can be found using: MediaQuery.of(context).size.width.truncate(). Be sure to take into account applicable safe areas.

Implementation

AdSize.getInlineBanner(this.width, int maxHeight)
    : height = maxHeight,
      _mode = 3 {
  if (width < 300 || maxHeight < 32) {
    throw FlutterError.fromParts(<DiagnosticsNode>[
      ErrorSummary('Invalid Inline Ad Size ($width x $maxHeight)'),
      ErrorHint(
          'The minimum supported values for Inline Ad Size is (300 x 32).'),
    ]);
  }
}