Original address: medium.com/flutter-com…
Original author: medium.com/ganesh.s.p…
Published: October 16, 2020 -10 minutes to read
Extension is a way to get things done quickly. Many extensions help reduce repetitive work, reduce template code, and so on. There are also extensions that help aid the development process, and even make development faster and more efficient.
If you’re looking for keyboard Shortcuts, you can check out my article Flutter–Visual Studio Code Shortcuts for Fast and Efficient Development.
How do I install the extension?
First, a quick review of how to install the extension. In VS Code, click the extension on the left, then search for the extension and click Install.
How do I install extensions
First, I hope you have Dart and Flutter extensions enabled, if not, you can get them here. Dart and Flutter. These provide a lot of functionality, and usually when you start using Flutter, you must install these.
Now, let’s jump into the extension and see what we can do with all the wonders.
1. Awesome Flutter Snippets
A great extension provided by Nash, who has been associated with flutter since its inception and has been an important contributor to the Flutter community. This extension is up to date, there are no known problems, and if there are any, you can go directly to Nash for any help.
Awesome Flutter Snippets is a collection of commonly used Flutter classes and methods. It speeds up your development by eliminating most of the template code associated with creating widgets. Widgets such as StreamBuilder and SingleChildScrollView can be created by typing the streamBldr and singleChildSV shortcuts, respectively.
In the latest version, 2.0.4, there are 37 shortcuts, some of which are statelessW for stateless widgets, statefulW for creating stateful widgets, and so on.
How to use it?
Simply enter the shortcut key (or start typing and select from code Assist) and press Enter/Return. Let’s create a stateful widget and name it Test.
Use the scary Flutter Snippets
2. Pubspec assistance
This is one of the most famous and used extensions created by Jeroen Meijer and suggested by many top FLUTTER developers. This makes it easier to add pubspec.yaml, all without leaving your editor. This only adds the latest version, so it can also be used to update existing pubs.
How to use it?
Just open the Command Palette (by default, Ctrl+Shift+P on Windows, ⌘+Shift+P on Mac) and search “Pubspec Assist”, type the package name and press Enter; It will take some time to search and provide results.
Then, select any of the available options.
Use PubSpec assist
Group 3.
This is a lightweight extension created by Felix Angelov, who is also a very famous contributor to the Flutter community. This provides support for the Bloc library and tools for the Flutter and AngularDart applications to effectively create Blocs and Cubits.
How to use it?
The command
You can activate the command by launching the command palette (by default, Ctrl+Shift+P on Windows and ⌘+Shift+P on Mac) and running input Bloc.New Bloc. New Bloc, or you can right click on the directory where you want to create Bloc /cubit and select command from the context menu.
Use the bloc – command
Code action
This extension provides some code actions that can be used like the GIF below. Select the widget you want to wrap, then right – click and select the desired code action. Example: Packaged with Bloc Builder
Use group – code action
Bloc, BlocProvider, etc.
4. 【FF】Flutter files
This extension allows rapid construction of the Flutter BLoC template in VS Code projects.
How to use it?
Right-click on a file or folder in the current project. You can find multiple options added to the context menu, such as New Bloc, New event, New model, New page, etc.
Using Flutter files
5. The Flutter tree
This is a nice syntax to build up the basic tree of parts. This makes it easier to make widget trees, but one problem is that you will have to learn a new syntax, as shown below. OneChild > MultipleChild [OneChild, MultipleChild [OneChild, OneChild], OneChild > OneChild].
The use of Flutter Tree
6. Flutter Intl
This helps to create a binding between the translation of your.arb files and your Flutter application. It generates boiler template code for the official Dart Intl library and adds auto-complete to the keys in the Dart code.
How to use it?
Open the command palette (default: Ctrl+Shift+P on Windows, ⌘+Shift+P on Mac) and search for the Flutter Intl: Initialize command. By default the en language is added by automatically creating the file lib/l10n/intl_en.arb. You can Add more locales to the Flutter Intl: Add locale command.
7. Json to Dart model
Given a JSON string, the library will generate all the necessary Dart classes to parse and generate JSON. This library is designed to generate flutter friendly model classes as recommended by the FLUTTER DOC. The extension supports both manual SERIalization of JSON and serialization of JSON using code generation libraries. You can convert from clipboard or from file.
How to use it?
Open the command palette (by default, Ctrl+Shift+P on Windows and ⌘+Shift+P on Mac) and search Json to Dart: Convert from Selection.
Use Json to the Dart model
Dart getter and setter
With this extension, you can easily create getters and setters for all the variables you need.
Simply select the variables you want, then right click and select the Generate Getters and Setters option.
Use dart catcher and setters
9. Bracket against shader 2
We often get lost in the maze of nested widget trees and nested classes and spend a lot of time looking for parenthesis pairs. This extension makes it easier to find parenthesis pairs by color-coding them. You can customize colors and many other features related to parentheses and displaying active ranges. It also provides keyboard shortcuts to expand (Shift + Alt + Right) and undo (Shift + Alt +left) parenthesis selections.
How to use it?
Use bracket on toner 2
10. Material icon theme
Material Theme Icons are folders that display attractive icon themes that look attractive. It also makes it easier to identify files and folders.
How to use it?
To launch the command palette (Default: Ctrl+Shift+P for Windows, ⌘+Shift+P for Mac), type Material Icons and select Activate Icon Theme. When activated, the icon will appear in your Explorer sidebar. It has a lot of customizations, like you can change colors and so on.
Material icon theme in the icon on the left.
11. Image preview
This is a very cool extension that can show image preview hovering, as well as over grooves, which can be done at the convenience of when you are working with a large number of images. You can preview the following file types: PNG, JPEG, JPG, GIF, SVG. This helps us from doing anything wrong in terms of image paths or names. If you hover over the path, the extension provides a link to the file and its dimensions in the project structure.
Using image preview
12. Color highlights
Most of the time, we use different colors, and this extension is handy to see the colors styled in our code.
Use color highlighting
13. Better reviews
This is another popular extension used by VS code developers. It helps to create colorful annotations, which actually makes them more readable. This helps maintain code comments in a better way. Comments can help other developers on the team or our future selves. You can write TODO in comments, which will help you not miss any important work in the future. In comments, you just need to start with * or! Or? Or TODO, it will automatically have a specific color.
Use better comments
14. Error lens
Error lenses help make diagnostics stand out, highlighting entire lines wherever the language produces them, and printing information online.
Use error lens
15. Todo Tree
Gruntfuggly’s Todo Tree is very convenient, not only in Flutter, but also in VS Code. It displays all the TODO and FIXME tags in your code as treeviews in the explorer, helping us solve these problems directly without having to search through the code manually, saving a lot of time.
Use TODO tree
Reward extension
Here are some other extensions that will help with the overall development.
1. Real-time sharing
It’s a must when you want to collaborate with others to edit and debug a project or file in real time. This is especially handy in WFH scenarios, as well as in remote work.
You can share your code, terminals, and servers with other users, and if you use the Live Audio extension, you can even add audio to your communication.
2. Code stream
CodeStream is a developer collaboration platform that integrates all of your basic development tools like GitHub, GitLab, Bitbucket, Slack, Teams, Jira, Trello, and more into VS Code. CodeStream reduces context switching and helps improve developer productivity by introducing Code reviews to VS Code.
If you have a team of developers and you work with them regularly, this extension will help you a lot.
3. The path is automatically completed
This is a very useful extension that will provide path integrity for your files or folders. This makes it easier to add images or any resources to our files.
4. Polacode-2020
This is useful if you are writing articles or tutorials. This extension helps you get nice screenshots of your code. There is also an older version that cannot be used with VS Code 2020.
How to use it?
Invoke the command palette (default: Ctrl+Shift+P on Windows, ⌘+Shift+P on Mac), type Polacode and select the code you want to take a screenshot.
5. GitLens–Git Super Edition
It helps you visualize code authorship at a glance through Git blame comments and code lenses, seamlessly navigate and explore Git repositories, gain valuable insights through powerful comparison commands, and much more.
I hope I’ve covered all the extensions THAT I can find and find mainly useful, follow me with more tips, tricks and pippant stuff. There are a whole bunch of useful keyboard shortcuts or tricks that I’ve covered in different articles.
Flutter- Visual Studio code shortcuts for fast and efficient development
If you have any other extensions or tricks for Visual Studio code, feel free to comment below and let me know.
If you enjoyed this article, please support me and clap your hands as often as possible 👏. Psst…… You can take up to 50 shots and I’ll be more motivated to bring more articles like this in the future.
Hi, I am Ganesh S. P. An experienced Java developer, a wide range of creative thinkers and entrepreneurs and speakers, who now venture into the world of Flutter. You can find me on LinkedIn or Github or follow me on Twitter. You can learn more about me here. In my free time, I’m a content creator for GadgetKada. You can also email me at [email protected] to talk about anything technology.
Translation via www.DeepL.com/Translator (free version)