Как изменить цвет фона ListTile? - PullRequest
0 голосов
/ 08 января 2019

Я делаю страницу настроек и хочу сделать как настройки iOS (серый фон и белая плитка). Я пытаюсь добавить контейнер, чтобы добавить цвет в ListTile, но всегда получаю сообщение об ошибке.

Кто-нибудь знает, как добавить контейнер здесь?

  body: new SingleChildScrollView(

        child: Column(

          mainAxisAlignment: MainAxisAlignment.center,
          crossAxisAlignment: CrossAxisAlignment.stretch,
          children: <Widget>[

               Column(

                children: <Widget>[

                  ListTile(
                    leading: Icon(
                      Icons.person,
                      color: Colors.grey,
                    ),
                    title: Text("Account"),
                    trailing: Icon(Icons.keyboard_arrow_right),
                  ),

1 Ответ

0 голосов
/ 08 января 2019

Просто оберните ListTile в Container

  Container(
        color: Colors.grey[200],
        child: ListTile(
          leading: Icon(
            Icons.person,
            color: Colors.grey,
          ),
          title: Text("Account"),
          trailing: Icon(Icons.keyboard_arrow_right),
        ),
      )
...