美文网首页
Flutter GetX bottomsheet 自定义高度设

Flutter GetX bottomsheet 自定义高度设

作者: Steven_2016 | 来源:发表于2023-07-12 11:05 被阅读0次

在不指定高度的情况下,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)),
          ),
          
        )
    );

效果如下:

效果

相关文章

网友评论

      本文标题:Flutter GetX bottomsheet 自定义高度设

      本文链接:https://www.haomeiwen.com/subject/unfpudtx.html