Live templates — Flutter

TheBoringDeveloper
The Startup
Published in
3 min readJun 13, 2020

Welcome! Today we will learn about live templates for flutter.

Recently I haven’t written many blogs but I have been blogging on Instagram.

Make sure you check out keyboard shortcuts-

Lets start

If you are checking out this blog, then most probably you are a programmer. Even if you don’t know flutter, this will be useful for you.

There is one thing which most of have in common- We don’t like writing the same code again and again. That is also why we love widgets in flutter and those beautiful flutter packages.

So what are live templates?

Live templates are used to insert common constructs into your code, such as loops, conditions, various declarations, or print statements.

Mostly for repeatable code blocks.

Now enough of theory!! Lets jump to the practical part.

Here are some live templates for flutter:

0. Create a stateless widget

1. Create a stateful widget

2. Navigate to another screen

3. Navigate to another screen and clear previous screens stack

4. Add a vertical gap

5. Add a horizontal gap

6. Create a For loop

7. Iterating an array

Added on 4th July 2020-

8. Close current screen

9. Add delay

These are some of the most common used templates.

You can also create your own live templates based on block of code you use repeatedly in your favourite IDE.

Live templates are not restricted to any specific framework or language

For android studio-

Comment below any more live templates which you think should be added to the list

Thank you for staying till the end

More flutter blogs-

I will be posting more about flutter, so stay tuned :)

--

--