Posts

Showing posts from January, 2020

When do you use the WidgetsBindingObserver?

What is the difference between a StatelessWidget and a StatefulWidget in Flutter?

Image
What is the difference between a  StatelessWidget  and a  StatefulWidget  inFlutter? A stateful widget is defined as any widget which changes its state within its lifetime. But it is a very common practice for a  StatelessWidget  to have a  StatefulWidget  as one of its children. Doesn't  StatelessWidget  become stateful if it has  StatefulWidget  as one of its children? I tried looking into the documentation as part of the code of  StatelessWidget , but couldn't figure out how a  StatelessWidget  can have  Statefulwidget  as its children and still remain  StatelessWidget . What is the relation and difference between stateful and stateless widgets in Flutter? StatefulWidgetvs StatelessWidget.   StatelessWidget   -- A widget that does not require mutable state. ·        A stateless widget is a widget that describes p...