-
-
Save Vanethos/fdc660ef47eb1c4e0aeda6eca2fc461d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class InjectorWidget extends InheritedWidget { | |
InjectorWidget({ | |
Key key, | |
@required Widget child, | |
}) : assert(child != null), | |
super(key: key, child: child); | |
static InjectorWidget of(BuildContext context) { | |
return context.inheritFromWidgetOfExactType(InjectorWidget) as InjectorWidget; | |
} | |
@override | |
bool updateShouldNotify(InjectorWidget old) => false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment