无法更改UserAccountsDrawerHeader背景

E.B*_*dos 2 dart flutter

我正在尝试将Drawer中的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);
        },
      ),

    ],
  ),
);
Run Code Online (Sandbox Code Playgroud)

MyDrawer:

我的抽屉

Tir*_*tel 5

由于尚未指定decoration属性,因此将颜色设置为主题的默认primaryColor。使用decoration属性设置颜色。

UserAccountsDrawerHeader(
    decoration: BoxDecoration(
        color: Colors.red,
    ),
    accountName: Text(sessionUsername),
    accountEmail: Text(mail),
    currentAccountPicture: CircleAvatar(
        backgroundColor: Colors.red,
        backgroundImage: NetworkImage(gravatarUrl),
    ),
),
Run Code Online (Sandbox Code Playgroud)