Your dart code can become a huge Bracket puzzle and also an unreadable one if it's not properly formatted. I call it a Bracket puzzle because it may be a little confusing to find the bracket you forgot to write in unreadable code.
We are talking about converting this
Center(child: AnimatedContainer(duration: Duration(milliseconds: 100), height: 300, width: 20, decoration: BoxDecoration(color: Colors.deepPurple),),To —- — -— — ⬇️ — — — — This
Center(
child: AnimatedContainer(
duration: Duration(milliseconds: 100),
height: 300,
width: 20,
decoration: BoxDecoration(color: Colors.deepPurple),
),There is a handy shortcut available for this. It’s Ctrl + Alt + R(PC) | ⌃ + ⌥ + R(Mac) in Android Studio but who likes to do this every time when you write code??
There is one option called ‘Format code on Save’ in the Android studio’s settings page which reformats code when you save. Isn’t it exciting?
Here are steps to enable it in Android studio.

- Go to settings.
- Click on Language and Framework section.
- Choose Flutter.
- Now you will find an option in the editor section.
No comments:
Post a Comment
Note: only a member of this blog may post a comment.