Why use InheritedWidget while we can use Broadcast Streams | StreamBuilder and Static Variables?
Why should we bother about redux, scoped model, etc. while we can have a simple and clean architecture?
Why use InheritedWidget while we can use Broadcast Streams | StreamBuilder and Static Variables?
Why should we bother about redux, scoped model, etc. while we can have a simple and clean architecture?
Streams/Sink definitely are excellent to store a state. There are some existing architectures, such as BLoC which uses them a lot.
But, Streams don't entirely replace InheritedWidget
either.
InheritedWidget
comes with the cool ability to override it's content for only a part of the screen.
One cool application of this is Theme
.
Generally speaking, Streams
are cool to store business logic. But when you need to store UI logic, InheritedWidgets
takes the upper hand.
InheritedWidget
pass info to it's children. While stream is inside the widget. So in the case of InheritedWidget
, other widgets can have influence. While with streams they can't –
Aeolus Theme
with streams, you'll easily understand –
Aeolus business logic
and what is UI logic
? –
Sheen © 2022 - 2024 — McMap. All rights reserved.