I'm trying to create Oval shape by using Radius.circular
but it looks like circular shape and I have also tried to change Radius.elliptical
but still getting a different shape.
Expanded(
flex: 13,
child: Container(
height: 100,
width:100,
margin: EdgeInsets.only(top: 40,left: 40,right: 40),
decoration: new BoxDecoration(
color: MyColors.colorPrimary,
border: Border.all(color: Colors.black, width: 0.0),
borderRadius:
new BorderRadius.all(Radius.elliptical(90,45)),
),
child: Text(' '),
),
I want this
but getting this
I assume you are using a Column
or Row
widget as parent and using Expanded
your child is trying to expand to the horizontal.
Add an Align
or Center
widget as a parent of your Container
and it should work:
Align(
child: Container(
height: 50,
width: 100,
margin: EdgeInsets.only(top: 40, left: 40, right: 40),
decoration: new BoxDecoration(
color: Colors.green,
border: Border.all(color: Colors.black, width: 0.0),
borderRadius: new BorderRadius.all(Radius.elliptical(100, 50)),
),
child: Text(' '),
),
),
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With