You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think this error is misguiding us "Invalid argument (Object of type RegisterModel is not registered inside GetIt. " and the error should be that you are missing to register(I am not sure what we say when we include in the main function) locator in the main function
I followed the written tutorial and video as well there was one thing missing that we need to include setupLocator(); in the main function.
in the get_it package description, it is also missing.
void main() {
setupLocator(); // I was missing setupLocator to regiter in then main function
runApp(MyApp());
}
Uh oh!
There was an error while loading. Please reload this page.
I have registered my model but it still says "RegisterModel is not registered inside GetIt"
Here is my View class
Here is View Model
Here is locator
class BaseModel extends ChangeNotifier {
ViewState _state = ViewState.Idle;
ViewState get state => _state;
void setState(ViewState viewState) {
_state = viewState;
notifyListeners();
}
}
The text was updated successfully, but these errors were encountered: