adaptiveConversion method

  1. @override
OverlayConfiguration<T> adaptiveConversion(
  1. BuildContext context
)
override

Returns an equivalent configuration adapted for the current platform, e.g. a PopoverConfiguration becomes a DrawerConfiguration on mobile.

Returns this by default (no adaptation). Called by showOverlay when adaptive: true (the default).

Implementation

@override
OverlayConfiguration<T> adaptiveConversion(BuildContext context) {
  if (handler == null && isMobile(Theme.of(context).platform)) {
    return toDrawer();
  }
  return this;
}