Answers for "how to show a listview in modal dialog flutter"

0

how to show a listview in modal dialog flutter

AlertDialog(
  title: Container(child: Padding(
    padding: const EdgeInsets.all(8.0),
    child: Text('Pick Item',style: TextStyle(color: Colors.white),),
  ),color: Colors.blueAccent,),
  content: setupAlertDialoadContainer(context),
);
Posted by: Guest on June-26-2021
0

how to show a listview in modal dialog flutter

Widget setupAlertDialoadContainer(context) {
  return Column(
    mainAxisSize: MainAxisSize.min,
    children: [
      Container(
        color: Colors.grey,
        height: 300.0, // Change as per your requirement
        width: 300.0, // Change as per your requirement
        child: ListView.builder(

          shrinkWrap: true,
          itemCount: 15,
          itemBuilder: (BuildContext context, int index) {
            return ListTile(
              title: Card(child: Padding(
                padding: const EdgeInsets.all(8.0),
                child: Text('List Item $index'),
              )),
            );
          },
        ),
      ),
      Align(
        alignment: Alignment.bottomRight,
        child: FlatButton(

          onPressed: (){
          Navigator.pop(context);
        },child: Text("Cancel"),),
      )
    ],
  );
}
Posted by: Guest on June-26-2021

Code answers related to "how to show a listview in modal dialog flutter"

Browse Popular Code Answers by Language