MediaQuery as InheritedModel | Behind the PR
Are you using MediaQuery properly?
MediaQuery has over 20 properties.
As an InheritedWidget, if a widget’s build method references MediaQuery.of(context) - the widget gets rebuilt when ANY of the properties change, even if you only access one property.
InheritedModel is an InheritedWidget that allows dependents to be notified when certain parts of the model change.
Watch more How to Flutter → https://goo.gle/HowToFlutter
#Flutter
MediaQuery has over 20 properties.
As an InheritedWidget, if a widget’s build method references MediaQuery.of(context) - the widget gets rebuilt when ANY of the properties change, even if you only access one property.
InheritedModel is an InheritedWidget that allows dependents to be notified when certain parts of the model change.
Watch more How to Flutter → https://goo.gle/HowToFlutter
#Flutter
Flutter
Welcome to the official Flutter YouTube channel. Subscribe to stay up to date with best practices about the Flutter SDK. See real code examples, and watch engineers from around the world putting Flutter to work!
Subscribe to stay connected → http://bit....