当内部DraggableScrollableSheet滚动时,如何使模态底部工作表回弹

时间:2020-03-16 08:28:36

标签: flutter

当内部DraggableScrollableSheet滚动时,如何使模态底板回弹

showModalBottomSheet(
      isScrollControlled: true,
      context: context,
      shape: RoundedRectangleBorder(
        borderRadius: BorderRadius.only(
          topLeft: Radius.circular(6.0),
          topRight: Radius.circular(6.0),
        ),
      ),
      builder: (context) {
        return DraggableScrollableSheet(
            initialChildSize: _childSize,
            maxChildSize: _childSize,
            minChildSize: 0.7,
            expand: false,
            builder: (BuildContext context, ScrollController scrollController) {
              return Container(
                height: 100,
                child: ListView.builder(
                  controller: scrollController,
                  itemCount: 25,
                  itemBuilder: (BuildContext context, int index) {
                    return ListTile(title: Text('Item $index'));
                  },
                ),
              );
            },
        );
      }
  );

0 个答案:

没有答案