showDialog method

void showDialog()

Implementation

void showDialog() {
  LogUtils.dWidget("ID:$id, node:$idDesc, fire modal show");
  var buildContext = context.getInstance(rootId)?.rootKey.currentContext;
  if (!isShowDialog && buildContext != null && children.isNotEmpty) {
    isShowDialog = true;
    var durationTime = 200;
    if (animationType == 'none' || animationSwitch == false) {
      durationTime = 0;
    } else if (animationDuration > 0) {
      durationTime = animationDuration;
    }
    showGeneralDialog(
      barrierLabel: MaterialLocalizations.of(buildContext).modalBarrierDismissLabel,
      barrierDismissible: true,
      barrierColor: Color(barrierColor),
      context: buildContext,
      useRootNavigator: false,
      transitionDuration: Duration(milliseconds: durationTime),
      transitionBuilder: (context, anim1, anim2, child) {
        return _animation(
          aniType: animationType,
          child: child,
          animation: anim1,
        );
      },
      pageBuilder: (context, animation, secondaryAnimation) {
        return _dialogRoot(
          child: ModalContainerWidget(this),
        );
      },
    ).then((value) {
      isShowDialog = false;
    });
    onShow();
  }
}