如何实现拱形appBar

问题描述 投票:0回答:1

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

enter image description here

flutter flutter-layout
1个回答
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))),
      ),
    ),
  );
}
© www.soinside.com 2019 - 2024. All rights reserved.