We can type
stful and we get Autocomplete Suggestion to generate Stateless Flutter Widget or Stateful Flutter Widget Respectively.
?? checks If something is
null. If it’s not null it returns its own value but if it’s
null it returns the value after
return abc??10; //returns 10 if abc is null else returns its own value,
It also has shorthand assignment when it’s null.
abc??=5 //assigns 5 to abc if it's null
We can define a function inside another function.
This is to encapsulate the inner function from everything else outside the outer function.
We can chain method/member calls without returning
this from method(), getter() and setter() using cascade operator (..)
try in Dartpad
Can be replaced with
Dart does not support data class by default, but with plugins, we can simply generate data class (
equals() methods implemented by the tool).
Download Plugins :
If you want to have a single text with different style within it? Do not bother or try to hack with with
Text() and use
Using Container with certain height/width to create responsive space between Widgets? That may look good on one screen but will not look the same in different screen size.
Spacer Widget comes for the rescue. Instead of
Container(width: / height: ), use
How on this earth did I not know about this widget earlier? This is going to save many lives 😂