简体   繁体   中英

How to make showBottomSheet continue to slide when showBottomSheet contains scrollable widgets?

When showBottomSheet contains scrollable widgets, after sliding down the [Scrollable widget] to the top, the showBottomSheet cannot continue to slide down, how to solve? Similar to the comment in Tik Tok.

using the built in widget DraggableScrollableSheet, this should be pretty simple:

showBottomSheet(
  context: context,
  builder: (context) {
    return DraggableScrollableSheet(
      maxChildSize: 0.5, // playing with these  4 
      minChildSize: 0.25, // values will give you 
      initialChildSize: 0.5, // different and interesting results
      expand: false,
      builder: (context, controller) {
        return SingleChildScrollView(
          controller: controller,
          child: Column(
            children: [
              for (var i = 0; i < 20; i++)
                ListTile(
                  title: Text(i.toString()),
                )
            ],
          ),
        );
      },
    );
  },
);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM