I am make settings page and want make like iOS settings (grey background and white tile). I am try add Container so can add color to ListTile but always get error.
Anyone know how to add Container here?
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),
),
Just wrap your ListTile
in a Container
Container(
color: Colors.grey[200],
child: ListTile(
leading: Icon(
Icons.person,
color: Colors.grey,
),
title: Text("Account"),
trailing: Icon(Icons.keyboard_arrow_right),
),
)
I wrap the ListTile
with a Material
widget and set the color. This will preserve the ripple effect of the listTile.
eg.
Material(
color: Colors.grey[300],
child: ListTile(
title: Text('Hello')
)
);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With