stateUpdated method
When you call updateState, this method will be called within your
State. The data
parameter will contain any data passed from the
updateState method.
E.g. updateState('my_state', data: "Hello World");
stateUpdated(dynamic data) { data = "Hello World" }
Implementation
@override
stateUpdated(dynamic data) async {
if (data is! Map) {
return;
}
if (data.containsKey("action")) {
String action = data["action"];
if (action == "enable") {
_alertEnabled = true;
} else if (action == "disable") {
_alertEnabled = false;
}
}
if (widget.rememberAlert == true) {
await NyStorage.save(stateName!, _alertEnabled);
}
}