水平列表

import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: Text("flutterDemo")),
body: HomeContent(),
));
}
}
class HomeContent extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
height: 180.0,
child: ListView(
scrollDirection: Axis.horizontal,
children: <Widget>[
Container(
width: 180.0,
height: 180.0,
color: Colors.red,
),
Container(
width: 180.0,
height: 180.0,
color: Colors.orange,
child: ListView(
children: <Widget>[
Image.network(
"https://www.itying.com/images/202004/goods_img/1101_P_1587123548040.jpg",
),
Text('我是文本'),
],
),
),
Container(
width: 180.0,
height: 180.0,
color: Colors.blue,
),
Container(
width: 180.0,
height: 180.0,
color: Colors.deepOrange,
),
Container(
width: 180.0,
height: 180.0,
color: Colors.deepPurpleAccent,
)
],
),
);
}
}
我是Eric,手机号是13522679763

浙公网安备 33010602011771号