YYFlutter/flutter-custom-dialog

在onTap中路由跳转会报错 '!_debugLocked': is not true

Chen-Yong-Jie opened this issue · 0 comments

YYDialog().build(context)
      ..width = 220
      ..borderRadius
      ..text(
        padding: EdgeInsets.all(25.0),
        alignment: Alignment.center,
        text: doubtStr,
        color: Colors.black,
        fontSize: 17.0,
        fontWeight: FontWeight.w500,
      )
      ..divider()
      ..doubleButton(
        padding: EdgeInsets.only(top: 10.0),
        gravity: Gravity.center,
        withDivider: true,
        text1: "取消",
        color1: Colors.blue,
        fontSize1: 14.0,
        fontWeight1: FontWeight.bold,
        onTap1: cancelTop,
        text2: "确定",
        color2: Colors.redAccent,
        fontSize2: 14.0,
        fontWeight2: FontWeight.bold,
        onTap2: () {
          Navigator.of(context).pushAndRemoveUntil(
          MaterialPageRoute(builder: (context) => LoginPage()),
          (route) => route == null);
    });
        },
      )
      ..show();

image