I have coded a SnackBar
inside the if condition, if the condition is true it has to show SnackBar
but it's not happening even when the condition is true.
this is my code
TextButton(
onPressed: () async {
await fetch();
await _scan();
setState(() {
total = initial! + last!;
});
if (total.toString() == scanResult.rawContent){
ScaffoldMessenger.of(context).showSnackBar(snackBar)
}
},
child: Text("scan")),
I don't know why it's not working when even the condition is true