Skip to content

Latest commit

 

History

History
44 lines (29 loc) · 1.35 KB

File metadata and controls

44 lines (29 loc) · 1.35 KB

How to set the border radius on a Flutter widget

I've been a Flutter dev for many years and I still need to Google "Flutter border radius" sometimes. 😅

Let's put it to rest! This is the easiest way to get a rounded rectangle with a given radius:

A couple things to note:

  • Container also has a decoration argument, but using DecoratedBox is more lightweight.
  • the above also works with BorderRadius.circular(16), however BorderRadius.all() is a const constructor and therefore more optimal.

Also published on codewithandrea.com 👇


Found this useful? Show some love and share the original tweet 🙏


Previous Next
Flutter Fix all command Chat UI with message bubbles