【发布时间】:2020-03-27 09:17:28
【问题描述】:
当我从应用程序内部切换应用程序主题时,我正在寻找一种方法来更改抽屉标题图像。
我的项目中有这段代码可以将图像加载到我的抽屉标题中。
但是必须要更改图像,就像可以使用 Theme.of(context).backgroundColor 更改颜色一样
child: ListView(
padding: EdgeInsets.zero,
children: <Widget>[
UserAccountsDrawerHeader(
accountName: const Text(_AccountName),
accountEmail: const Text(_AccountEmail),
currentAccountPicture: CircleAvatar(
backgroundColor: Colors.brown,
child: Text(_AccountAbbr),
),
decoration: BoxDecoration(
color: Colors.blue,
image: DecorationImage(
image: AssetImage('assets/md_drawer_header.jpg'),
fit: BoxFit.cover,
),
),
),
),
【问题讨论】:
标签: android iphone flutter dart