ExtendedPopScope<T> constructor

ExtendedPopScope<T>({
  1. Key? key,
  2. required Widget child,
  3. bool canPop = false,
  4. PopInvokedWithResultAndOverlayCallback? onPopInvokedWithResult,
  5. PopInvokedWithOverlayCallback? onPopInvoked,
  6. bool isCloseOverlay = true,
})

Implementation

ExtendedPopScope({
  super.key,
  required super.child,
  super.canPop = false,

  /// 支持 3.24
  PopInvokedWithResultAndOverlayCallback? onPopInvokedWithResult,

  /// 3.24之前的版本保留
  PopInvokedWithOverlayCallback? onPopInvoked,

  /// true 点击android实体返回按键先关闭Overlay【loading ...】但不pop 当前页面
  bool isCloseOverlay = true,
}) : super(onPopInvokedWithResult: (bool didPop, T? result) {
        bool isClose = false;
        if (isCloseOverlay && ExtendedOverlay().overlayEntryList.isNotEmpty) {
          isClose = true;
          closeOverlay();
        }
        onPopInvoked?.call(didPop, isClose);
        onPopInvokedWithResult?.call(didPop, result, isClose);
      });