How to create a modal bottomsheet with circular corners in Flutter?

前端 未结 9 1138
时光取名叫无心
时光取名叫无心 2020-12-05 02:25

showModalBottomSheet does not provide any styling or decorations. I want to create something like the Google Tasks bottomsheet.

9条回答
  •  既然无缘
    2020-12-05 02:47

    Putting together all the answers before, I could achieve the best result possible (in my opinion) for this.

    showModalBottomSheet(
            context: context,
            backgroundColor: Colors.white,
            shape: RoundedRectangleBorder(
              borderRadius: BorderRadius.only(topLeft: Radius.circular(15.0), topRight: Radius.circular(15.0)),
            ),
            builder: (context) {
              return Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                mainAxisSize: MainAxisSize.min,
                children: [     
                  ListTile(
                    leading: Icon(Icons.email),
                    title: Text('Send email'),
                    onTap: () {
                      print('Send email');
                    },
                  ),
                  ListTile(
                    leading: Icon(Icons.phone),
                    title: Text('Call phone'),
                     onTap: () {
                        print('Call phone');
                      },
                   ),                  
                ],
              );
            });
    

提交回复
热议问题