i wanna add radius to container how to add radius to container? when i try to add decoration to container its does not showing up.
Container(
alignment: Alignment.centerLeft,
decoration: kBoxDecorationStyle,
height: 60,
child: TextField(
keyboardType: TextInputType.emailAddress,
style: TextStyle(color: Colors.white, fontFamily: 'OpenSans'),
decoration: InputDecoration(
border: InputBorder.none,
contentPadding: EdgeInsets.only(top: 14.0),
prefixIcon: Icon(
Icons.email,
color: Colors.white,
),
hintText: 'Enter your Email',
hintStyle: kHintTextStyle),
),
),
CodePudding user response:
You can use decoration propery of Container:
Container(
width: 300,
height: 60,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(30),
color: Colors.amber,
),
child: Center(child: Text('Radius')),
),
But remember, you must use color property in the decoration if you add decoration property to a Container.
CodePudding user response:
Different ways you can choose which one suits you
Container(
width: 100,
height: 100,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
color: Colors.red,
),
),
or
ClipRRect(
borderRadius: BorderRadius.circular(20),
child: Container(
width: 100,
height: 100,
color: Colors.red,
),
),