showLayer static method

dynamic showLayer(
  1. BuildContext context,
  2. Widget child, {
  3. Function? onClosed,
})

显示弹出框

Implementation

static showLayer(BuildContext context, Widget child, {Function? onClosed}) {
  showDialog<Null>(
    context: context,
    barrierDismissible: false,
    builder: (BuildContext context) {
      return child;
    },
  ).then((val) {
    print("关闭窗口:" + val.toString());
    if (onClosed != null) {
      onClosed(val);
    }
  });
}