- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
我正在尝试将抽屉中的 UserAccountsDrawerHeader 背景从浅蓝色更改为另一种颜色,但我找不到解决方案。谁能帮帮我?
return Drawer(
child: ListView(
// Important: Remove any padding from the ListView.
padding: EdgeInsets.zero,
children: <Widget>[
UserAccountsDrawerHeader(
accountName: Text(sessionUsername),
accountEmail: Text(mail),
currentAccountPicture: CircleAvatar(
backgroundColor: Colors.red,
backgroundImage: NetworkImage(gravatarUrl),
),
),
ListTile(
title: Text('Home'),
leading: Icon(Icons.home, color: myColor),
onTap: () {
print("Going to home");
//Close the drawer
Navigator.of(context).pop();
//Navigate to home page
//Navigate with avoiding the possibility to return
Navigator.of(context).pushReplacementNamed(HomePage.tag);
},
),
],
),
);
我的抽屉:
最佳答案
由于您没有指定 decoration
属性,因此颜色设置为主题的默认 primaryColor。使用 decoration
属性设置颜色。
UserAccountsDrawerHeader(
decoration: BoxDecoration(
color: Colors.red,
),
accountName: Text(sessionUsername),
accountEmail: Text(mail),
currentAccountPicture: CircleAvatar(
backgroundColor: Colors.red,
backgroundImage: NetworkImage(gravatarUrl),
),
),
关于dart - 无法更改 UserAccountsDrawerHeader 背景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55420478/
我正在尝试将抽屉中的 UserAccountsDrawerHeader 背景从浅蓝色更改为另一种颜色,但我找不到解决方案。谁能帮帮我? return Drawer( child: ListView
我在登录后从 URL 收到了我的回复,但我只能在我的控制台中打印数据,但如何从该回复中获取邮件和姓名 我已经尝试过 future 的响应,但是当我得到一个 future 的响应但返回错误时 登录页面.
我正在学习 flutter 。我使用抽屉小部件使用 UserAccountsDrawerHeader 小部件,但是在设置 Radius 时,下面出现了不必要的行。如何删除它? 这是我的代码 drawe
当我想在 flutter endDrawer 中使用 UserAccountsDrawerHeader 时,如何设置所有头像图像以及 accountEmail 和 accountName 在抽屉的 中
我正在使用 Flutter UserAccountsDrawerHeader 小部件来显示用户的数据,但我无法弄清楚如何实现 onDetailsPressed() 函数来调用用户详细信息。这是我的代码
我是一名优秀的程序员,十分优秀!