Reputation: 417
I'm new in flutter and I want to make a round container. I have done this but I don't know how to adjust the value to adapt it. Is there a better solution? Thanks in advance.
Widget Cube() {
return Container(
width: 70, height: 70,
child: Container(
width: 64, height: 64,
decoration: BoxDecoration(
color: CalendarColor.blue,
borderRadius: BorderRadius.all(
Radius.circular(32),
)
),
),
);
}
Upvotes: 0
Views: 936
Reputation: 4130
You can also use RawMaterialButton for more options like this:
RawMaterialButton(
elevation: 2.0,
fillColor: Colors.black,
shape: CircleBorder(),
onPressed: () {});
},
)
Upvotes: 1
Reputation: 12803
Is there a better solution?
How about FoatingActionButton
?
FloatingActionButton(
backgroundColor: Colors.blue,
elevation: 0.0,
child: Text("15", style: TextStyle(color: Colors.white)),
onPressed: () {})
Upvotes: 1
Reputation: 672
Container(
decoration: BoxDecoration(
shape: BoxShape.circle //This will make container round
)
)
Upvotes: 2