📜  带有构建器颤振的 showdialog - Dart 代码示例

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

代码示例2
BuildContext dialogContext; // <<----
  showDialog(
    context: context, // <<----
    barrierDismissible: false,
    builder: (BuildContext context) {
      dialogContext = context;
      return Dialog(
        child: new Row(
          mainAxisSize: MainAxisSize.min,
          children: [
            new CircularProgressIndicator(),
            new Text("Loading"),
          ],
        ),
      );
    },
  );

  await _longOperation();
  Navigator.pop(dialogContext); // <<----