I'm studying flutter by VSCode and I use auto-completion.
When I use StatelessWidget I always see
const MyApp({Key key}) : super(key: key);
What is this mean?
Is this always necessary code when i using StatelessWidget?
I'm studying flutter by VSCode and I use auto-completion.
When I use StatelessWidget I always see
const MyApp({Key key}) : super(key: key);
What is this mean?
Is this always necessary code when i using StatelessWidget?
no it is not necessary but it is usefully for frameWork during rebuild widget to identify that this widget is already in widget tree or not. for more information you can follow the Key in flutter.