Skip to main content
InterviewHubPRO
Section Overview
Q3

Question 3 of 50

Part 1: Basic & Foundational Concepts (Junior / Entry-Level)

6%
Flutter & Dart (50 Qs)•Part 1: Basic & Foundational Concepts (Junior / Entry-Level)

What is the difference between `StatelessWidget` and `StatefulWidget`?

junior LevelflutterBasic

In Simple Words:

  • StatelessWidget: Immutable. Its UI configuration depends solely on arguments passed into its constructor. It has no internal mutable state that changes over time (e.g. Text, Icon). Overrides Widget build(BuildContext context).
  • StatefulWidget: Mutable. Maintains state that can change during the widget's lifetime (e.g. user input, check boxes, network data).
    • Composed of two classes: the immutable StatefulWidget configuration and the persistent State<T> object that holds mutable fields and calls setState().