I want to add background that has circle like picture below:
And in my Figma, has asset like this:
And my code is like this:
Widget buildItem(int index) => Card(
color: ColorName.brandSecondaryBlue,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(15),
),
child: Container(
padding: const EdgeInsets.only(top: 20, bottom: 20),
child: buildItem(),
),
);
Anyone else who know how to add it?
3
Answers
May not be a clean way but try Using a
Stack
widget and usePositioned
widget inside.Here’s a sample for what you are trying to achieve.
Try This Code:
export your figma component with the just the background( purple with circles).
Then add that in assets and use it in the child of Card. So your widget tree would be :
You can also crop the image to get just the top corner ring or play with the fit property in DecorationImage widget.