flutter showModalBottomSheet 设置圆角不生效?并没有坑

siman 2024-6-19 11:12:22 394 0 来自河北
flutter showModalBottomSheet 设置圆角不生效?网上说有坑  各种嵌套 改色 方案 其实里面有裁剪行为设置了就行!

  1. showModalBottomSheet(
  2.       context: context,
  3.       isScrollControlled: true,
  4.       clipBehavior: Clip.antiAlias, // 设置剪裁行为
  5.       constraints:
  6.       shape: RoundedRectangleBorder(
  7.         borderRadius: BorderRadius.only(
  8.           topLeft: Radius.circular(10.w),
  9.           topRight: Radius.circular(10.w),
  10.         ),
  11.       ),
  12.       builder: (context) {
  13.         return myShowBottomSheet(model: model,index: index,);
  14.       },
  15.     );
复制代码
单独设置RoundedRectangleBorder  是不生效的  漏底色  


重要的是这个 clipBehavior: Clip.antiAlias, // 设置剪裁行为


这个设置了就正常了 !
您需要登录后才可以回帖 登录 | 立即注册

Powered by CangBaoKu v1.0 小黑屋藏宝库It社区( 冀ICP备14008649号 )

GMT+8, 2024-9-8 08:13, Processed in 0.152413 second(s), 36 queries.© 2003-2025 cbk Team.

快速回复 返回顶部 返回列表