Flutter realizes the bottom pop-up box

 

  _blockUser(BuildContext context){
    showModalBottomSheet(
        context: context,
        isDismissible: true,
        isScrollControlled: false,
        shape: const RoundedRectangleBorder(borderRadius: BorderRadius.only(topLeft: Radius.circular(15), topRight: Radius.circular(15))),
        builder: (BuildContext context) {
          return Container(
            decoration: const BoxDecoration(
              color: Colors.white,
              borderRadius: BorderRadius.only(topLeft: Radius.circular(15),topRight: Radius.circular(15))
            ),
            height: ScreenAdapter.height(370),
            child: Column(
              children: [
               Container(padding: const EdgeInsets.fromLTRB(15, 20, 15, 5),child:  Text("将联系人'测试屏蔽人名称名称名称'屏蔽,同事删除该联系人的聊天记录",maxLines:2,style: TextStyle(color: const Color.fromRGBO(236, 94, 104, 1),fontSize: ScreenAdapter.size(25)),),),
                const Divider(),
                Padding(padding: EdgeInsets.only(bottom: ScreenAdapter.height(10)),child: Center(child: Text("删除联系人",style: TextStyle(color: Colors.red,fontSize: ScreenAdapter.size(30)),),),),
                Container(color: const Color.fromRGBO(250, 250, 252,0.5),height: ScreenAdapter.height(15)),
                InkWell(
                  onTap: (){
                    Navigator.pop(context);
                  },
                  child:Container(padding: const EdgeInsets.fromLTRB(0,10,0,15),child:  Text("取消",style: TextStyle(color: const Color.fromRGBO(236, 94, 104, 1),fontSize: ScreenAdapter.size(30)),)),),
              ],
            ),
          );
        });
  }

Guess you like

Origin blog.csdn.net/u013600907/article/details/126363363