AdaptivePopupRoute<T> constructor

AdaptivePopupRoute<T>({
  1. required WidgetBuilder builder,
  2. RouteSettings? settings,
  3. double? contentWidth,
  4. double? contentHeight,
  5. Color barrierColor = Colors.transparent,
  6. bool barrierDismissible = true,
  7. Duration duration = const Duration(milliseconds: 100),
  8. double? top,
  9. double? bottom,
  10. double? left,
  11. double? right,
})

AdaptivePopupRoute

use to show/hide popup route in an adaptive way

Example:

Navigator.of(context).push(
  AdaptivePopupRoute(
    builder: (_) => build,
    settings: null,
    top: position.top,
    right: position.right,
    bottom: position.bottom,
    left: position.left,
    contentHeight: dropDownHeight,
    contentWidth: dropDownWidth,
  ),
);

Implementation

AdaptivePopupRoute({
  required this.builder,
  RouteSettings? settings,
  this.contentWidth,
  this.contentHeight,
  this.barrierColor = Colors.transparent,
  this.barrierDismissible = true,
  this.duration = const Duration(milliseconds: 100),
  this.top,
  this.bottom,
  this.left,
  this.right,
}) : super(settings: settings);