Answers for "listview in dialog flutter"

0

listview in dialog flutter

Widget setupAlertDialoadContainer() {
  return Container(
    height: 300.0, // Change as per your requirement
    width: 300.0, // Change as per your requirement
    child: ListView.builder(
      shrinkWrap: true,
      itemCount: 5,
      itemBuilder: (BuildContext context, int index) {
        return ListTile(
          title: Text('Gujarat, India'),
        );
      },
    ),
  );
}
Posted by: Guest on October-17-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
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

Browse Popular Code Answers by Language