Member-only story

Here are the new set of 5 Best practices to become a pro flutter developer
The other parts of this series links are provided at the end of this article.
1. Use final/const keyword for unmodified variables
“final” means single-assignment: a final variable or field must have an initializer. Once assigned a value, a final variable’s value cannot be changed. final modifies variables.
final should be used over const if you don’t know the value at compile time, and it will be calculated/grabbed at runtime.
if you have a const collection, everything inside of that is in const. If you have a final collection, everything inside of that is not final.
There are lot more differences and examples for more understanding.
// Don’tString firstName = “John”
int a = 1// Dofinal String firstName = “John”
const int a = 1//or const a = 1
2. Don’t use ‘+’ for concatenating strings, use string interpolation
// Don't
final String firstName = "John";
final String text = firstName + " Doe"