toggle method
Implementation
void toggle(BuildContext context, {bool forceLock = false}) {
context.guardoActionWithResult(
onSuccess: () async {
state = !state;
await JetStorage.write(_key, state);
if (forceLock) {
if (context.mounted) {
context.lockApp();
}
}
},
onFailure: (e) {
context.showToast(e.toString());
},
);
}