64- Flutter State Management - InheritedWidget Counter Example

preview_player
Показать описание
Base class for widgets that efficiently propagate information down the tree.

Inherited widgets, when referenced in this way, will cause the consumer to rebuild when the inherited widget itself changes state.
source code
Рекомендации по теме
Комментарии
Автор

If I need to move Button element to a separate file and use it as a separate component. This example will not work cause CounterProvide context will work only as a default state. And after incrementing it will work as a local state but will not affect the elements inside the provider.

Ceditor