Member-only story
Top 5 Flutter Tips You wish you knew earlier!
In this article we will discuss about the top 5 flutter tips and tricks that will help us build better apps.
🎥 Video Tutorial
🔭 Implementation
In order to view all the changes or if you happen to face issues with any of the tip which we are about to discuss, then make sure you have the latest flutter SDK installed in your device or try upgrading your flutter sdk to the latest one.
→ Tip #1
Rendering multiple widgets under single conditional statement.
In dart we won’t be able to wrap two or more widgets under single conditional statement inside the build method. Moreover we won’t be able to group them using curly bracket as well.
if(condition)
widget1(), //condition applies for only widget1
widget2(),
Therefore in order to achieve this we go for wrapping them using square bracket [] and make use of the spread operator (…) to group two or more widgets under single conditional…