Change background color of ListTile upon selection in Flutter

前端 未结 12 1782
闹比i
闹比i 2020-12-15 03:10

I\'ve made a ListView in Flutter, but now I have some ListTiles in this ListView that can be selected. Upon selection, I want the back

12条回答
  •  无人及你
    2020-12-15 03:55

    I was able to change the background color of the ListTile using a BoxDecoration inside Container:

    ListView (
        children: [
            new Container (
                decoration: new BoxDecoration (
                    color: Colors.red
                ),
                child: new ListTile (
                    leading: const Icon(Icons.euro_symbol),
                    title: Text('250,00')
                )
            )
        ]
    )
    

提交回复
热议问题