📜  Flutter 中的模态叠加 - Dart 代码示例

📅  最后修改于: 2022-03-11 14:48:07.240000             🧑  作者: Mango

代码示例1
await showGeneralDialog(
  context: context,
  pageBuilder: (BuildContext buildContext,
      Animation animation,
      Animation secondaryAnimation) {
    return SafeArea(
      child: Builder(builder: (context) {
        return Material(
            color: Colors.transparent,
            child: Align(
                alignment: Alignment.center,
                child: Container(
                    height: 200.0,
                    width: 250.0,
                    color: Colors.white,
                    child:
                        Center(child: Text('Testing')))));
      }),
    );
  },
  barrierDismissible: true,
  barrierLabel: MaterialLocalizations.of(context)
      .modalBarrierDismissLabel,
  barrierColor: null,
  transitionDuration: const Duration(milliseconds: 150));