Skip to content

Instantly share code, notes, and snippets.

@qaz10102030
Created January 19, 2022 05:43
Show Gist options
  • Save qaz10102030/7bcf41dc71700544b4ec6b7c61f7fc95 to your computer and use it in GitHub Desktop.
Save qaz10102030/7bcf41dc71700544b4ec6b7c61f7fc95 to your computer and use it in GitHub Desktop.
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),
);
},
))),
),
);
}
}
@qaz10102030
Copy link
Author

ezgif-6-6ed1b08dbf

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