Sublime Text is a great and fast text editor. I mainly use that for coding Python but for some weeks now, I also code Flutter on it
It is recommended to code Flutter on Android Studio, Visual Studio Code or IntelliJ. Those are also great text editors for Flutter because they give code completion, syntaxe analysis, great errors debugging and so on. That’s clear, you can not code flutter without one of those text editors or IDE.
So why am I using Sublime Text for Flutter ?
Well, for a few months now, I have been using a 2 Go Ram PC. Yep ! That’s not great. The minimum recommended Ram by Android Studio is 4 Go Ram. But I am so in love with programming that I said I don’t care, I need to code. Here I am. Android Studio and Visual Studio Code for flutter are really required in minimum 4 Go Ram elsewhere, like in my case, the PC is bugging, slowing and coding is not pleasant at all. It’s why I turn to Sublime Text.
Sublime Text is just speed, no bugging, no slowing the PC, just awesome but without text completion and others flutter features which are on Android Studio or Visual Studio Code. But I’ve found some Tips for making coding Flutter in Sublime Text for Productive.
Tips 1: Dart language
Sublime Text does not support dart out of the box, you need to add that by yourself via Sublime Package Control. With this support of the dart language, you will be notified of syntax errors, type errors, deprecated class or functions, linting and some more dart exclusive features. Only with that, you can start coding dart on Sublime Text.
Tips 2: Snippets
In Sublime Text, there is an option where you can add your own custom snippet, I’ve created a bunch of them for StatelessWidget, StatefullWidget and many more. With those snippets, coding Flutter in Sublime Text has become more easier.
Tips 3: Search for Documentation
One of the greatest features in Visual Studio Code is when you put the cursor on a class or function, you can see parameters and the documentation. There is no feature like this on Sublime Text but the flutter team has done a great work on well documented flutter. so what I do to access a Widget, class or function documentation, I just do a global search on the flutter package directory.
And for a package, I just do the same thing in the package directory.
I know what you’re saying, that’s painful. But in fact, I do not mainly use those documentation on the computer, mainly, I just google it and find documentation on flutter.dev or on stackoverflow. But I wanted to show an alternative when it may be offline.
Tips 4: All AutoComplete
This package extends the Sublime Text completion to all open files of the current window. For avoiding repeating words. By the way, the dart language in Sublime Text supports class property completion, so when you write like Icons. Sublime Text shows the available IconData.
Tips 5: GitGutter
GitGutter helps showing all git diff in the file. you can discard changes and see where changes were made.
Tips 6: SideBarEnhancements
Sublime Text has not created a file or created a dir when we click on a folder. SideBarEnhancements add extra options on the cursor pop up menu.
That’s it, if like me, you have a low Ram PC, instead of doing nothing, you can start creating a mobile app with Sublime Text or Just for fun, you can try coding Flutter on Sublime Text with not so much help from Visual Studio Code or Android Studio.