Skip to content

Instantly share code, notes, and snippets.

@adityapatnaik
Created September 4, 2019 09:11
Show Gist options
  • Save adityapatnaik/4156805f5362146b5edc683929501d02 to your computer and use it in GitHub Desktop.
Save adityapatnaik/4156805f5362146b5edc683929501d02 to your computer and use it in GitHub Desktop.
ListView Widget
ListView(
padding: const EdgeInsets.all(8.0),
scrollDirection: Axis.horizontal, // scrollDirection: Axis.vertical, implements vertical scrolling
children: <Widget>[
Container(
height: MediaQuery.of(context).size.height/4,
width: MediaQuery.of(context).size.width/3,
color: Colors.amber[600],
child: const Center(child: Text('Entry A')),
),
Container(
height: 50,
width: MediaQuery.of(context).size.width/3,
color: Colors.amber[500],
child: const Center(child: Text('Entry B')),
),
Container(
height: 50,
width: MediaQuery.of(context).size.width/3,
color: Colors.amber[100],
child: const Center(child: Text('Entry C')),
),
Container(
height: 50,
width: MediaQuery.of(context).size.width/3,
color: Colors.amber[50],
child: const Center(child: Text('Entry D')),
),
],
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment