import 'package:flutter/material.dart'; void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'Widgets Demo', home: Scaffold( appBar: AppBar(title: Text('Widgets Demo')), body: SingleChildScrollView( child: Column( children: [ // SingleChildScrollView with Column for (var color in [ Colors.red, Colors.green, Colors.blue, Colors.black, Colors.grey, ]) Container(height: 200, color: color), // ListView ListView( shrinkWrap: true, children: [ 'one', 'two', 'three', 'four', 'five', 'six', ].map((e) => Text(e)).toList(), ), // ListView.builder ListView.builder( shrinkWrap: true, itemCount: ['fifth', 'first', 'ninth', 'second', 'eight'].length, itemBuilder: (context, index) => Text( ['fifth', 'first', 'ninth', 'second', 'eight'][index], ), ), // GridView.count GridView.count( shrinkWrap: true, crossAxisCount: 3, children: [ Colors.red, Colors.green, Colors.blue, Colors.black, Colors.grey, Colors.green, ] .map((color) => Container(height: 200, color: color)) .toList(), ), ], ), ), ), ); } }