Skip to content

Instantly share code, notes, and snippets.

@NITIN-ME

NITIN-ME/main.dart

Created Jun 30, 2020
Embed
What would you like to do?
class MyBody extends StatefulWidget {
@override
_MyBodyState createState() => _MyBodyState();
}
class _MyBodyState extends State<MyBody> {
void call(int index){
setState(() {
items.removeAt(index);
});
}
@override
Widget build(BuildContext context) {
return ListView.builder(
itemCount: items.length,
itemBuilder: (context, index) {
return Person(name: '${items[index]}', idx: index, cb: call);
},
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment