I want to do the following widget on Flutter:
As you can see, it's pretty hard. One idea would be to use .png for the buttons cutted by the circle, but I don't think this would look good on high resolutions.
My idea, currently, is to use a Stack
so I can place the buttons where they neeed to be. Then I can put a blank circle on the center to erase the buttons. However this is still not good, because then the widget could only be placed on places with blank background.
Should I stick with the Stack
approach?
I started with something like this:
Container(
width: 200,
height: 150,
child: Stack(children: <Widget>[
Column(
children: [
Row(
children: [
FractionallySizedBox(
widthFactor: 0.5,
heightFactor: 0.5,
child: Container(
decoration: BoxDecoration(
color: Color(0xFFA93EF0),
shape: BoxShape.rectangle,
),
)),
FractionallySizedBox(
widthFactor: 0.5,
heightFactor: 0.5,
child: Container(
decoration: BoxDecoration(
color: Color(0xFFA93EF0),
shape: BoxShape.rectangle,
),
))
],
),
Row(
children: [
FractionallySizedBox(
widthFactor: 0.5,
heightFactor: 0.5,
child: Container(
decoration: BoxDecoration(
color: Color(0xFFA93EF0),
shape: BoxShape.rectangle,
),
)),
FractionallySizedBox(
widthFactor: 0.5,
heightFactor: 0.5,
child: Container(
decoration: BoxDecoration(
color: Color(0xFFA93EF0),
shape: BoxShape.rectangle,
),
))
],
)
],
)
]))
but I get
BoxConstraints forces an infinite width and infinite height.
I don't know why since I placed things inside a Container
with fixed size (which is also undesired).
UPDATE:
I tried the answer below, but it requires a colored circle.
Is it possible to draw this by some other method?