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
>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(),