Alert Dialog with Rounded corners in flutter

前端 未结 8 1861
渐次进展
渐次进展 2020-12-23 13:30

I am trying to create an alert dialog with rounded corners in Flutter same as below screenshot. also add my code here, but my output is exactly different from the expected o

8条回答
  •  旧时难觅i
    2020-12-23 13:49

    If you want to use the standard Dialog you can just apply a Decoration to the Container that matches your Dialog settings

    showDialog(
          context: context,
          child: Dialog(
            shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
            child: Column(
              children: [
                Container(
                  decoration: BoxDecoration(     
                    borderRadius: BorderRadius.only(topLeft: Radius.circular(10), topRight: Radius.circular(10)),
                  ),          
                  child: Text('foobar'),
                )
              ],
            ),
          ),
        );
    

提交回复
热议问题