I have a problem with my flutter project, I create button to display dialog with form and textfield, when dialog is open then I tap texfield, page is recreate, this is my code
void _showDialog(){
showDialog(
context: context,
builder: (BuildContext context) {
return CupertinoAlertDialog(
title: Text('Add New'),
content: Card(
color: Colors.transparent,
elevation: 0.0,
child: Column(
children: <Widget>[
TextField(
decoration: InputDecoration(
labelText: "Item",
filled: true,
fillColor: Colors.grey.shade50),
),
],
),
),
);
},
);
}
how I can solve it? thank you so much for your help