showLog method

void showLog()

显示JhDebug弹层窗口

Implementation

void showLog() {
  if (!_judegInit() || _layerFlag) return;

  _layerFlag = true;
  if (getGlobalContext != null) {
    showGeneralDialog(
      context: getGlobalContext!,
      barrierLabel: "jhDialog",
      barrierDismissible: true, // 是否点击其他区域消失
      barrierColor: Colors.black54, // 遮罩层背景色
      transitionDuration: Duration(milliseconds: 150), // 弹出的过渡时长
      pageBuilder: (context, animation, secondaryAnimation) {
        jhConfig.context = context;
        return Dialog(child: _layerWidget);
      },
      transitionBuilder: (
        BuildContext context,
        Animation<double> animation,
        Animation<double> secondaryAnimation,
        Widget child,
      ) {
        // 显示的动画组件
        return ScaleTransition(
          scale: Tween<double>(begin: 0, end: 1).animate(animation),
          child: child,
        );
      },
    ).then((v) {
      _layerFlag = false;
      logDataUtls.clearSearch(); // 清余关键字
    });
  }
}