Flutter GetX bottomsheet 自定义高度设

2023-07-12  本文已影响0人  Steven_2016

在不指定高度的情况下,getx bottomsheet 会自适应高度,一般高度最高是当前手机屏幕的5/9 ,如果需要指定高度,需要特殊设置

//设置 isScrollControlled 属性为true  然后通过对Container高度设置来完成对bottomsheet高度设置
 return Get.bottomSheet(
      isScrollControlled:true,
        Container(
          height: 656.h,  //设置自定义高度
          margin: EdgeInsets.only(left: 20.w,right: 20.w,bottom: 60.h),
          decoration: const BoxDecoration(
            color: KColor.catPluginAlertBackColor,
            borderRadius:BorderRadius.all( Radius.circular(10.0)),
          ),
          
        )
    );

效果如下:

效果
上一篇 下一篇

猜你喜欢

热点阅读