Friday, June 16, 2023

Stateful V/S Stateless Widgets

 There are mainly two types of widgets in Flutter, Stateless and Stateful widgets both are useful for creating Flutter apps for Example when a user interacts with it and the widget can change it is known as Sateful Widget. Checkbox, Radio, Slider, InkWell, Form, and TextField.

If any action on the UI requires the widget to be rebuilt, then this is where you should use the Stateful widget. But if the widget only displays data, and any action on the UI does not need to rebuild the widget, then you can use the Stateless widget. The shortcut for creating this widget is "stful"

Whereas Stateless widgets never change, IconIconButton, and Text. Stateless widgets are useful when the part of the user interface you are describing does not depend on anything other than the configuration information in the object itself and the BuildContext in which the widget is inflated. The shortcut for creating this widget is "stless".





No comments:

Post a Comment

REST API

  A n API, or  application programming interface , is a set of rules that define how applications or devices can connect to and communicate ...