For some reason even though I have the auth in the Provider widget, it still returns as null can you help me out please?
elompo23 opened this issue · comments
elompo23 commented
code:
class Provider extends InheritedWidget {
final AuthService auth;
Provider({Key key, Widget child, this.auth, }) : super(key: key, child: child);
@OverRide
bool updateShouldNotify(InheritedWidget oldWidget) {
return true;
}
static Provider of(BuildContext context) =>
(context.dependOnInheritedWidgetOfExactType());
}
Mayur Sanjay Deshmukh commented
change context.dependOnInheritedWidgetOfExactType() to (context.dependOnInheritedWidgetOfExactType<Provider>());