我正在尝试复制Telegram的导航。我尝试了多种方法来控制Drawer-Header Widget上的Accounts Expansion磁贴,就像在应用程序上一样,每次需要一个全状态的widget并显示空的Expansion Widget时。是否有任何想法如何从无状态窗口小部件中执行此操作以及如何删除下拉图标(完全隐藏帐户)
DrawerHeader(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
ListTile(
leading: CircleAvatar(
backgroundImage: NetworkImage(
'https://images.unsplash.com/photo-1547425260-76bcadfb4f2c?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=60',
),
),
trailing: Icon(Icons.save),
),
ListTile(
title: Text(
'Dave John',
style: TextStyle(
color: Colors.white,
),
),
subtitle: Text(
'daveJohn@gmail.com',
style: TextStyle(
color: Colors.white,
),
),
trailing: Icon(
Icons.arrow_drop_down,
),
)
],
),
decoration: BoxDecoration(
color: Colors.blue,
),
),
ExpansionTile(
children: <Widget>[
ListTile(
leading: CircleAvatar(
backgroundColor: Colors.green,
child: Text('A'),
),
title: Text('Anmol'),
),
ListTile(
leading: CircleAvatar(
backgroundColor: Color(0xFF8982E9),
child: Text('AS'),
),
title: Text('Anmol Sach'),
),
ListTile(
leading: Icon(Icons.add),
title: Text('Add Account'),
)
],
),