Answers for "flutter list tile backgroud color"

1

flutter listtile color

ListTile(
              tileColor: Colors.blue[100], // Defines the background color of ListTile when selected is false.
              leading: FlutterLogo(),
              title: Text('ListTile'),
            ),
Posted by: Guest on August-25-2021
-1

how to change background color of list view in flutter

class PageTwoState extends State<PageTwo> {
  @override
  Widget build(BuildContext context) {
    return ListView.builder(
      itemExtent: 250.0,
      itemBuilder: (context, index) => Container(
            padding: EdgeInsets.all(10.0),
            child: Material(
              elevation: 4.0,
              borderRadius: BorderRadius.circular(5.0),
              color: index % 2 == 0 ? Colors.cyan : Colors.deepOrange,
              child: Center(
                child: Text(index.toString()),
              ),
            ),
          ),
    );
  }
}
Posted by: Guest on November-23-2020

Code answers related to "Dart"

Browse Popular Code Answers by Language