[英]How to create a curved container in flutter
I'm trying to create this design in flutter我正在尝试在颤动中创建这个设计
when i try to increase the height of curved container to create the MyDocs container design, its curved get disturb.当我尝试增加弯曲容器的高度来创建 MyDocs 容器设计时,它的弯曲会受到干扰。 please help how to do this.请帮助如何做到这一点。
here is my code这是我的代码
Widget build(BuildContext context) {
return SafeArea(
child: Container(
child: Column(children: [
ClipPath(
clipper: ProsteThirdOrderBezierCurve(
position: ClipPosition.bottom,
list: [
ThirdOrderBezierCurveSection(
p1: Offset(0, 100),
p2: Offset(0, 210),
p3: Offset(MediaQuery.of(context).size.width, 100),
p4: Offset(MediaQuery.of(context).size.width, 200),
),
],
),
child: Container(
decoration: const BoxDecoration(
color: Color.fromARGB(255, 52, 84, 109),
),
height: 200,
child: Column(children: [
const SizedBox10(),
Padding(
padding: const EdgeInsets.all(8.0),
child: SizedBox(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height * 0.07,
child: TextField(
decoration: InputDecoration(
suffixIcon: const Icon(Icons.search),
contentPadding: const EdgeInsets.all(20.0),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(30.0),
),
filled: true,
hintStyle: TextStyle(color: Colors.grey[800]),
hintText: "Search...",
fillColor: Colors.white70),
),
),
),
]),
),
),
here is its output这是它的输出
You can use ClipPath widget, with custom clippers.您可以将ClipPath小部件与自定义剪辑器一起使用。
For custom clippers you can try flutter_custom_clippers package.对于自定义剪裁器,您可以尝试使用 flutter_custom_clippers包。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.