5 mind-blowing Flutter tips and tricks, that you can use right away!

0
 


Today I’m going to current to you 5 extraordinarily beneficial flutter hints that you can straight away practice to your project. I won’t existing you any applications or extensions, however very simple, however extraordinarily beneficial tips! 

Cleaner folder structure:

After growing a new flutter project, there are way too many files. But we can shape these archives with very easy steps in VSCode:

1.Open the command palette (Ctrl/Cmd + Shift + P)
2.type “preferences: Open Settings (JSON)”
3.add the following strains to your settings.json: 



Here is a before and after comparison:




As you can see, many files that we rarely use are now hidden in pubspec.yaml. Of course you can expand pubspec.yamland access these files.


Auto Fix linters:

It’s very worrying to repair all the linter issues one via one. Even if you use for instance the “add const keyword” dialog, doing this each time is in lengthy time period very time-consuming. That’s why we will create a way to routinely add these small matters when saving a file. To do so, we go again to our settings.json (Instructions in the preceding tip) and add the following: 



Awesome Flutter Snippets:

I know, I know, I’ve stated that I won’t add an extension to this hints article, however this extension is a must-have for each Flutter developer. It gives you so many extraordinary Flutter snippets that you can use proper away to velocity up your development. It has 40+ snippets for each use case and helps complicated widgets: 



Print vs log:

Sometimes, if you desire to print an error to the console, the error is way too lengthy to be displayed. This is due to the fact print has a persona limit. To show the error, simply use log(message) instead: 



Easier formatting:

In the 2d tip, we have spoken about how to add matters like const key phrases automatically. Now we desire to structure our file as quickly as we store it. To do so, add the following line to your settings.json: 



Further reading & Conclusion:

In this article, you have seen 5 tips that are extremely useful.


Post a Comment

0Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.
Post a Comment (0)

#buttons=(Accept !) #days=(20)

Our website uses cookies to enhance your experience. Learn More
Accept !