GestureDetector onTap() doesn't work in release mode [flutter]

505 Views Asked by At

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');
            }
            });
        },
)
0

There are 0 best solutions below