如何在Flutter中创建切口形状

vnjpjtjt  于 2022-12-24  发布在  Flutter
关注(0)|答案(2)|浏览(115)

我试着找出如何构建类似于图片的东西,但没有结果。我试着使用CircularNotchedRectangle代码,并把它放在一个CustomPainter中,但不知道如何调整它。
任何建议将不胜感激!!

nue99wik

nue99wik1#

你可以使用Flutter Shape Maker在线工具。在这个工具的帮助下,你可以创建你的自定义形状,它会给予你一个代码的形状。

cngwdvgl

cngwdvgl2#

您可以将它放在ScaffoldbottomNavitationBar属性上,并使用BottomAppBar小部件以及notchMarginshape来放置您的CircularNotchedRectangle

Scaffold(
  ...
  bottomNavigationBar: BottomAppBar(
    notchMargin: 6.0,
    shape: CircularNotchedRectangle(),
    child: Row(
      mainAxisAlignment: MainAxisAlignment.spaceEvenly,
      children: <Widget>[
        ...
      ],
    ),
  ),
);

相关问题