I have a gesture detector that calls setState() in a stateful widget. It works fine in debug mode, but when I compile to release apk, the GestureDetector doesn't make anything in the onTap().
This is my code:
GestureDetector(
child: Icon(Icons.search),
onTap: () {
setState(() {
if(mostrarTextField.toString() == 'Text("Empresas")'){
mostrarTextField = TextField(
controller: controller,
decoration: InputDecoration(
intText: 'Buscar empresas...'
),
onSubmitted: (value){
Navigator.push(context, MaterialPageRoute(
builder:(context) =>
BusquedaEmpresas(
busqueda: controller.text,
nombreUsr: nombreUsr,
documentoUsr: documentoUsr,
)
)
);
},);
}else{
mostrarTextField = Text('Empresas');
}
});
},
)