I just wanna ask few questions
- Should i wrap my normal widget with stateless or stateful when using?
- 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
>Solution :
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.