3

I know that StatefulWidget allows us to change widgets, while StatelessWidget does not.

But if StatefulWidget can perform everything that StatelessWidget can perform + more, why would I ever use StatelessWidget over StatefulWidget?
Is StatelessWidget better in anyways other than that it's easier to implement?

Yousef Gamal
  • 1,026
  • 2
  • 17
  • 32

1 Answers1

8

You'll get a small performance gain using StatelessWidget. It's very negligible but it's there.

Outside of this, there are some architectural gains. A StatelessWidget is entirely immutable. This is important enough to justify using Stateless over Stateful when there's no need for a State.

Rémi Rousselet
  • 256,336
  • 79
  • 519
  • 432