-3

I just wanna ask few questions

  1. Should i wrap my normal widget with stateless or stateful when using?
  2. What is the different of using it as is?

I just wanna build re usable widget and wondering if i should wrap it before re using! Thanks for answering

Niiko
  • 1
  • 1

1 Answers1

-1

Use StatelessWidget if your widget will not change value. For example: you want to display a Container with color red and it is not going to change colour.

Use StatefulWidget if your widget will change value. For example: you want to display a number 10, and this number will be increased to 11 or decreased to 9 by pressing a button.

Ivone Djaja
  • 477
  • 6
  • 13