The InheritedWidget Mixin

Greg Perry
Follow Flutter
Published in
16 min readMar 22, 2024

--

In your app’s interface, rebuild only those widgets you want to.

Here, copy this gist, inheritedwidget_state_mixin.dart, and you’ll have a mixin that provides you with a powerful capability by implementing an InheritedWidget to any particular State class. When you then call that State object’s setState() method, it won’t rebuild its whole interface — only selected parts of it. Thus making such rebuilds much more efficient. You don’t want a complex interface with dozens of widgets rebuilt over and over again! That’s poor performance. In this article, a simple example app will be used…

--

--