I want to show a SimpleDialog with ListView.builder in my Flutter app with this code:
showDialog(
context: context,
builder: (BuildContext context) {
you can create a separate method method for SimpleDialogOptions code below:
final SimpleDialog dialog = new SimpleDialog(
title: const Text('Select assignment'),
children: [
new SimpleDialogOption(
onPressed: () { Navigator.pop(context); },
child: const Text('Text one'),
),
new SimpleDialogOption(
onPressed: () {},
child: const Text('Text two'),
),
],
);
return dialog;