How to Make One Side Circular Border Of Widget In Flutter?

in flutter •  3 years ago 

Many of you are familiar with the Container Widget. It is nothing but a parent widget that contains child widgets to manage its frontend property like height, background, width & color. This article will cover How a developer can create One Side Circular Border Of Widget In Flutter?

How to Make One Side Circular Border Of Widget In Flutter?

Use BorderRadius.only and Provide the Sides.

Center(
child: Container(
height: 100,
width: 100,
decoration: BoxDecoration(
borderRadius: BorderRadius.only(topRight: Radius.circular(40)),
border: Border.all(width: 3,color: Colors.green,style: BorderStyle.solid)
),
child: Center(child: Text("Hello")),
),
),

The output will look like the below:

One Side Rounded CornerOne Side Rounded Corner

  • Use BorderRadius.only and be specific if you need one side of the container to be rounded which corners to round.:
    Container(
    width: 150.0,
    padding: const EdgeInsets.all(20.0),
    decoration: BoxDecoration(
    borderRadius: BorderRadius.only(
    topRight: Radius.circular(40.0),
    bottomRight: Radius.circular(40.0)),
    color: Colors.white),
    child: Text("hello"),
    ),

Conclusion:

Thanks for being with us on a Flutter Journey !!!

In this article, we have been through How to Make One Side Circular Border Of Widget In Flutter?

Keep Learning !!! Keep Fluttering !!!

Our Flutter Agency portal is dedicated to Flutter & its relatable technology to help Flutter Developers. Check out our website for cool resources, specially handpicked from the Flutter news industry like the latest Widget Guide, Flutter Projects, Code libs, etc.

Article source: https://flutteragency.com/one-side-circular-border-of-widget-in-flutter/

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!