Listview inside DraggableScrollableSheet not scrolling in flutter

前端 未结 2 1800
不思量自难忘°
不思量自难忘° 2021-02-13 17:55

I am designed very heavy nested design like below, the issue when my list expands the listview doesn\'t seems to be scrolling what is the reason for this, the bottomsheet gets e

2条回答
  •  生来不讨喜
    2021-02-13 18:37

    Screenshot:


    Call this method:

    void showMyBottomSheet(BuildContext context) {
      showModalBottomSheet(
        context: context,
        isScrollControlled: true,
        builder: (_) {
          return DraggableScrollableSheet(
            maxChildSize: 0.8,
            expand: false,
            builder: (_, controller) {
              return Column(
                children: [
                  Container(
                    width: 100,
                    height: 8,
                    margin: EdgeInsets.symmetric(vertical: 10),
                    decoration: BoxDecoration(
                      borderRadius: BorderRadius.circular(20),
                      color: Colors.grey,
                    ),
                  ),
                  Expanded(
                    child: ListView.builder(
                      controller: controller,
                      itemCount: 100,
                      itemBuilder: (_, i) => ListTile(title: Text('Item $i')),
                    ),
                  ),
                ],
              );
            },
          );
        },
      );
    }
    

提交回复
热议问题