//flutter import 'package:flutter/material.dart'; void main() { return runApp(TestPage()); } //リスト4.28 class TestPage extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'ListView', home: Scaffold( appBar: AppBar(title: Text('ListView')), body: HogeListWidget() ) ); } } class HogeListWidget extends StatefulWidget { @override State<HogeListWidget> createState() => _HogeListWidgetState(); } class _HogeListWidgetState extends State<HogeListWidget> { final itemList = List.generate(500, (i) => 'Item$i'); @override Widget build(BuildContext context) { return ListView( children: List.generate(100, (i) => ListTile( leading: FlutterLogo(size: 56.0), title: Text('ListTile$i'), subtitle: Text('Item$i'), onTap: () {}, trailing: Icon(Icons.more_vert), ) ) ); } }