上效果
代码如下:
import 'package:flutter/material.dart';
class ListViewDemo extends StatelessWidget {
const ListViewDemo({super.key});
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('ListView Demo!'),
),
body: ListView1()),
);
}
}
class ListView1 extends StatelessWidget {
const ListView1({super.key});
Widget build(BuildContext context) {
return ListView(
padding: const EdgeInsets.all(80.0),
children: const <Widget>[
Text("I'm dedicating every day to you"),
Text('Domestic life was never quite my style'),
Text('When you smile, you knock me out, I fall apart'),
Text('And I thought I was so smart'),
],
);
}
}
这种写法还真意外
========END