How to create a transparent full screen dialog on top of activity - Flutter

后端 未结 3 797
挽巷
挽巷 2021-02-05 06:32

I am trying to create a transparent full screen dialog on top of activity. I have tried following this thread but solution doesn\'t work.

In short , what I need

3条回答
  •  余生分开走
    2021-02-05 07:22

    Screenshot (showGeneralDialog):


    Code:

    Widget build(BuildContext context) {
      return Scaffold(
        body: SizedBox.expand(child: FlutterLogo()),
        floatingActionButton: FloatingActionButton(
          child: Icon(Icons.open_in_new),
          onPressed: () {
            showGeneralDialog(
              context: context,
              barrierColor: Colors.black54,
              pageBuilder: (_, __, ___) => Container(child: Material(child: Text('Dialog'))),
            );
          },
        ),
      );
    }
    

提交回复
热议问题