flutter showModalBottomSheet处理程序和dismissble

polkgigr  于 2023-10-22  发布在  Flutter
关注(0)|答案(1)|浏览(175)

不允许:true,//不工作
showDragHandle:true,//在BottomSheet容器之外
这两个功能不适用于此底页
public void transmitting(transmitting context){
showModalBottomSheet(

context: context,
isScrollControlled: true,
isDismissible: true,
showDragHandle:true,
backgroundColor: Colors.transparent,
builder: (BuildContext context) {
  return DraggableScrollableSheet(
    initialChildSize: 0.5,
    maxChildSize: 0.7, // Set the maximum height to 70% of the screen height
    minChildSize: 0.2,
    expand: false,
    builder: (BuildContext context, ScrollController scrollController) {
      return Container(
        color: Colors.white, // Background color of the bottom sheet
        child: SingleChildScrollView(
          controller: scrollController,
          child: Column(
            children: [
              // Your content here
            ],
          ),
        ),
      );
    },
  );
},

); }

9cbw7uwe

9cbw7uwe1#

默认情况下,isDismissable:true检查文档[https://api.flutter.dev/flutter/material/showModalBottomSheet.html]还检查如何使用此函数

相关问题