问题描述
我想用这个弯曲的凹口来实现这个小部件,但我不能像下图那样从中心切割容器,边框半径。
这是我的目标小部件
这在我的代码中
BottomAppBar(
shape: CircularNotchedRectangle(),child: Container(
height: MediaQuery.of(context).size.height * .07,width: MediaQuery.of(context).size.width,alignment: Alignment.center,decoration: Boxdecoration(
gradient: LinearGradient(
end: Alignment.centerRight,begin: Alignment.centerLeft,colors: [
blueColor,lightColor,],),child: Padding(
padding: const EdgeInsets.only(left: 16,right: 16),child: Row(
children: [
Image.asset(
"assets/images/home.png",height: MediaQuery.of(context).size.height * .035,width: MediaQuery.of(context).size.width * .3,Spacer(),Image.asset(
"assets/images/cart.png",
编辑:用什么方式可以使用自定义画家来实现这种情况!
解决方法
在你的地方,我会用那个设计制作一个图像,但没有图标,你稍后用堆栈添加图标,所以我解决了复杂的设计。 这不是一个坏主意...
,使用自定义剪刀。 (在 YouTube 上寻找自定义剪刀教程)