Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Class and Stateless Widget

First of all I would like to say that I am new to Flutter.

I don’t understand the difference between class and stateless widget. I understand why I’m using stateful , because of setState. but why should I use statless instead of just class ?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Difference is actually depends on your application really but using class is more preferable in most cases. They are same, for the performance part, if you will not call setState in Widget. There are other differences like testability and accuracy. I suggest you first watch official flutter tutorial before using which one to use.
Official tutorial

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading