StateNotifier using either Ref or WidgetRef #1152
-
This discussion is about having a state notifier that wants to read values held by other providers, using either the The problem encountered is that abstract class AppController<State> extends StateNotifier<State> {
AppController(this.read, State initialState) : super(initialState);
final Reader read;
} However, I wondered why |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
That's voluntary. The fact that you need a common interface shows a flaw in your architecture You most definitely did something wrong somewhere. You should never need to use WidgetRef outside of widgets |
Beta Was this translation helpful? Give feedback.
That's voluntary. The fact that you need a common interface shows a flaw in your architecture
You most definitely did something wrong somewhere. You should never need to use WidgetRef outside of widgets