1
I have an app for QRCODE scanner and I have the following check:
// Executa função para o scanner
Future _scan() async {
String barcode = await scanner.scan();
if (barcode.contains("cx-")) {
// this._outputController.text = barcode;
onPressed: (){
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ScanCx()
),
);
};
}else {
print("Código não encontrado!");
}
}
However, when it falls into the if contains Cx, it arrives in the onPress
he is not doing the navigation to the screen ScanCx
.
What am I doing wrong?