import 'package:flutter/material.dart';
void main(List<String> args) {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'XXX',
home: Scaffold(
appBar: new AppBar(
title: new Text('appBar'),
),
body: Center(
child: Container(
height: 200,
child: mylist(),
),
),
));
}
}
class mylist extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ListView(
scrollDirection: Axis.horizontal,
children: [
new Container(
width: 100,
color: Colors.yellow,
),
new Container(
width: 100,
color: Colors.lightBlue,
),
new Container(
color: Colors.red,
width: 100,
),
new Container(
width: 100,
color: Colors.purple,
),
new Container(
width: 100,
color: Colors.lightBlue,
)
],
);
}
}