Created
January 19, 2022 05:43
-
-
Save qaz10102030/7bcf41dc71700544b4ec6b7c61f7fc95 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:flutter/material.dart'; | |
| void main() { | |
| runApp(const MyApp()); | |
| } | |
| class MyApp extends StatefulWidget { | |
| const MyApp({Key? key}) : super(key: key); | |
| @override | |
| MyAppState createState() { | |
| return MyAppState(); | |
| } | |
| } | |
| class MyAppState extends State<MyApp> { | |
| final items = List<String>.generate(10, (i) => 'Item ${i + 1}'); | |
| @override | |
| Widget build(BuildContext context) { | |
| const title = 'Dismissing Items'; | |
| return MaterialApp( | |
| title: title, | |
| theme: ThemeData( | |
| primarySwatch: Colors.blue, | |
| ), | |
| home: Scaffold( | |
| appBar: AppBar( | |
| title: const Text(title), | |
| ), | |
| body: Center( | |
| child: SizedBox( | |
| width: 200.0, | |
| height: 300.0, | |
| child: ListView.builder( | |
| itemCount: items.length, | |
| itemBuilder: (context, index) { | |
| final item = items[index]; | |
| return ListTile( | |
| tileColor: Colors.blue, | |
| title: Text(item), | |
| ); | |
| }, | |
| ))), | |
| ), | |
| ); | |
| } | |
| } |
Author
qaz10102030
commented
Jan 19, 2022

Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment