I am using ble manager to turn the bluetooth on and off but when I move the switch it remains in the initial state and does not execute the if conditional.
body:Switch(value: state,
onChanged: (bool s)async{
state=s;
if(s==true){
print("is true");
await Future.delayed(Duration(seconds:3));
initState();
_bleManager.enableRadio();
}else{
print("is false");
_bleManager.disableRadio();
}
}
)