Adding a border to a widget in Flutter
This is a repost of an answer I wrote on Stack Overflow.
There are a couple ways to add a border to a Flutter widget. The most basic way is to wrap your widget in a
DecoratedBox. However, the
Container widget also has a
DecoratedBox built in. In the following examples I will use
Container for the convenience of adding margin and padding.