Stateful and Stateless Widget

Compare how stateful and stateless widgets can help us to build our UI with Flutter.

To make any Dart class a Flutter widget, we have to extend that class. This class can extend either StatelessWidget or StatefulWidget abstract classes. These two widget classes come shipped with Flutter SDK. We’ll go over both abstract classes in detail.

State

The state is a change in our domain objects. Assume we are making an Instagram app in which we have a post domain object with fields like postedBy, createdAt, numberOfLikes, etc.

These fields together make up a state for this particular post object. Now suppose a follower clicks the ...