如何实现拱形appBar

时间:2019-04-08 11:29:10

标签: flutter flutter-layout

我正在尝试在Flutter中实现这种AppBar,有关如何实现这一点的任何建议?

enter image description here

1 个答案:

答案 0 :(得分:1)

您可以尝试

enter image description here

@override
Widget build(BuildContext context) {
  return Scaffold(
    body: Material(
      elevation: 12,
      borderRadius: BorderRadius.only(bottomRight: Radius.elliptical(500, 70), bottomLeft: Radius.elliptical(500, 70)),
      color: Colors.transparent,
      child: Container(
        width: double.infinity,
        height: 100,
        padding: EdgeInsets.only(bottom: 12),
        alignment: Alignment.bottomCenter,
        child: Text("dride", style: TextStyle(fontSize: 18, fontWeight: FontWeight.w500, color: Colors.white)),
        decoration: BoxDecoration(color: Colors.grey[800], borderRadius: BorderRadius.only(bottomRight: Radius.elliptical(500, 70), bottomLeft: Radius.elliptical(500, 70))),
      ),
    ),
  );
}