What is a Widget in Flutter?

 Everything in Flutter is a widget — text, button, padding, layout, etc.

Widgets are building blocks of the Flutter UI.

Types of Widgets:

  1. StatelessWidget:

    • Immutable — once built, it doesn’t change.

    • Example: Text, Icon, RaisedButton.

  2. StatefulWidget:

    • Mutable — can change during runtime.

    • Example: Checkbox, TextField, Slider.

Comments

Popular posts from this blog

1. What is Flutter?

What is FutureBuilder and StreamBuilder?