如何在flutter中制作悬停应用栏?

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

我想要实现的是下图:

我尝试调整应用栏的大小,但没有用:

      appBar: PreferredSize(
        preferredSize:
            Size.fromHeight(60.0),
        child: Container(
          margin: EdgeInsets.all(8.0),
          child: AppBar(
            title: Text('Login'),
          ),
        ),
      ),

android flutter user-interface
1个回答
0
投票

尝试这样:

appBar: PreferredSize(
  preferredSize: const Size.fromHeight(60.0),
  child: ClipRRect(
    borderRadius: const BorderRadius.vertical(
      bottom: Radius.circular(50),
    ),
    child: AppBar(
      title: const Text('Login'),
      backgroundColor: Colors.red,
    ),
  ),
)

结果:

© www.soinside.com 2019 - 2024. All rights reserved.