【发布时间】:2021-11-26 15:32:18
【问题描述】:
我正在尝试显示一个 SliverAppBar,如我的设计所示
但我不确定是否可以在 Flutter 中完成
这是我目前的代码
SliverAppBar(
// title: ,
backgroundColor: Colors.grey[200],
expandedHeight: 300,
centerTitle: true,
shape: const ContinuousRectangleBorder(
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(100),
bottomRight: Radius.circular(100))),
actions: <Widget>[
CircleAvatar(
radius: 20,
// foregroundColor: Colors.red,
backgroundImage: AssetImage(
'assets/img/categories/player.png',
),
),
],
flexibleSpace: FlexibleSpaceBar(
background: Container(),
centerTitle: true,
title: Container(
height: 40,
child: Column(
children: [
Text("Mrs Surname Name",
style: TextStyle(
fontFamily: 'Kannada Sangam MN',
fontWeight: FontWeight.w500,
fontSize: 20,
// color: AppTheme.high_emphasis,
)),
],
),
),
),
pinned: true,
floating: false,
elevation: 0,
),
我希望即使向上滚动头像也能显示名称和图案,但更小
但是向上滚动时要隐藏的“常量”????
【问题讨论】:
标签: flutter dart flutter-layout flutter-sliver