Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

remove row at icon pressed – flutter

I have this icon

 IconButton( icon: Icon(Icons.delete,
            color: Colors.blueAccent[200]),
            onPressed: () {
               setState(() {});
            },
            ) ;

when I clicked on Icon I need to remove entire row with all contents inside it .
here is the row code :

Row(children: [Column(
                            children: [
                              Text(
                                "Text",
                                style: TextStyle(
                                  fontSize: 14.0,
                                ),
                              ),
                              Text(
                               "text",
                                style: TextStyle(
                                  fontSize: 12.0,
                                  color: Colors.grey[400],
                                ),
                              )
                            ],
                          ),
                          SizedBox(
                            width: 30.0,
                          ),
                          IconButton(
                            icon: Icon(Icons.delete,
                                color: Colors.blueAccent[200]),
                            onPressed: () {
                              setState(() {});
                            },
                          )
                        ],
                      ),

How can I do that . Can anyone help me please

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

this is the code for to do that

bool isActive=true;

'''''
'''''
'''''
'''''

Widget build(BuildContext context) {

'''''
'''''
'''''
'''''

isActive?

     Row(children: [Column(
                            children: [
                              Text(
                                "Text",
                                style: TextStyle(
                                  fontSize: 14.0,
                                ),
                              ),
                              Text(
                               "text",
                                style: TextStyle(
                                  fontSize: 12.0,
                                  color: Colors.grey[400],
                                ),
                              )
                            ],
                          ),
                          SizedBox(
                            width: 30.0,
                          ),
                          IconButton(
                            icon: Icon(Icons.delete,
                                color: Colors.blueAccent[200]),
                            onPressed: () {
                              setState(() {

                              isActive=false

                                });
                            },
                          )
                        ],
                      ),
         :Container(),
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading