Motivation

Life is short. Time is precious. Make the most of it.

There’s a really good article on WaitBuyWhy about how the weeks in your life are like diamonds.

You have this small spoonful of diamonds and you really want to create a life in which they’re making you happy.

I’m happy when I’m coding in the zone. And I see my IDE as a powerful extension of my brain.

Here I share some of my favourite shortcuts for Flutter development, so that I can save myself and everyone else a lot of time. 😉

This list applies to IntelliJ IDEA, but also to Android Studio as it is based on the IntelliJ platform. Let me know if I missed any good shortcuts. 💪

First things first

IntelliJ IDEA is extremely configurable and I use as my IDE of choice for Flutter development.

You can see the default keymaps by selecting Help → Keymap Reference , which links to this handy PDF reference.

Spend some time getting familiar with existing keymaps. Then, you can optimise your workflow and bind your own keys. It’s totally worth it!

You can configure custom keymaps in the preferences:

IntelliJ IDEA → Preferences or ⌘, , then Keymap :

My favourite keymaps

This list is a combination of generic and Flutter-specific shortcuts that I use in my workflow.

Reformat Code with dartfmt

Made changes to a source file and want to reformat code?

Code → Reformat Code with dartfmt

→ My keymap: ⌥⌘L

How does it work? Say your indentation is a bit messy, like this:

Fixing indentation by hand? Forget it.

Automated and consistent formatting is just one shortcut away.

Hot Tips

Adding a comma on the last parameter will format the code across multiple lines:

Omitting the comma on the last parameter will keep the code inline:

Most stock widgets in Flutter have a lot of optional parameters, so keeping them in separate lines can be a big win.