How to add border to a widget in flutter

How to add border to a widget in flutter

If you want to add border to widget in flutter you can use code below (remember: for this tutorial we are using Text widget you can use same structure to add border to any other widget).

Container(
  margin: const EdgeInsets.all(15.0),
  padding: const EdgeInsets.all(3.0),
  decoration: BoxDecoration(
    border: Border.all(color: Colors.blueAccent)
  ),
  child: Text('My Awesome Border'),
)

Result:



- Last updated 3 months ago

Be the first to leave a comment.

You must login to leave a comment