accessCurrentState method
void
accessCurrentState(
- AFAccessCurrentStateDelegate delegate
inherited
Synchronously accesses the current public state, providing it to a callback.
Critical: You cannot use this in UI rendering code to access state that is not in your state view. Your UI will only rebuild when data in your state view (or route parameter) change. So, if you use this method to try to access other state as part of your rendering code, then your UI won't update properly when that state changes.
However, you can use this in event handler code (usually within your SPI). That said, you should not usually need to.
Implementation
void accessCurrentState(AFAccessCurrentStateDelegate delegate) {
final context = AFCurrentStateContext(
dispatcher: this,
targetStore: targetStore,
);
delegate(context);
}