Tanzeem Iqbal
Tanzeem Iqbal

Reputation: 171

Custom Container border in flutter

Hello friends I am new don't know how to make a custom border kindly help me to generate this type of border. https://i.sstatic.net/MAlwG.png

Upvotes: 0

Views: 571

Answers (1)

Tunahan Akdogan
Tunahan Akdogan

Reputation: 256

Adding a border to a widget is very easy in Flutter. We just need to wrap the widget in a Container and add BoxDecoration to it.

Let’s say we want to make a square with blue borders all we need to do is:

Container(
  height: 100,
  width: 100,
  decoration: BoxDecoration(
    border: Border.all(
      color: Colors.blue,
    ),
    borderRadius: BorderRadius.circular(10.0),
  ),
  child: Center(
    child: Text('mrflutter.com'),
  ),
),

Also in the link there are other types

Source

Also there is a tutorial about BoxDecoration widget Boxdecoration tutorial

Upvotes: 1

Related Questions