show<T> method

Future<T?> show<T>({
  1. required WidgetBuilder builder,
  2. AxisDirection direction = AxisDirection.left,
  3. double? maxPrimarySize,
  4. bool enabledDrag = true,
  5. Color modalColor = Colors.black54,
  6. bool ignoreModalPointer = false,
  7. bool enabledFade = false,
})

通过路由打开抽屉,适用于无需保持状态的弹窗

Implementation

Future<T?> show<T>({
  required WidgetBuilder builder,
  AxisDirection direction = AxisDirection.left,
  double? maxPrimarySize,
  bool enabledDrag = true,
  Color modalColor = Colors.black54,
  bool ignoreModalPointer = false,
  bool enabledFade = false,
}) async {
  final route = _ElDrawerRoute<T>(
    direction: direction,
    drawerMaxSize: _calcDrawerMaxSize(
      size: maxPrimarySize,
      overlaySize: el.router.overlay.context.size!,
      direction: direction,
    ),
    enabledDrag: enabledDrag,
    modalColor: modalColor,
    ignoreModalPointer: ignoreModalPointer,
    enabledFade: enabledFade,
    builder: builder,
  );

  return await el.router.push<T>(route);
}