I’m trying to re-create a button I made with React Native that had different colours for each side giving it a kind of chiseled effect, a bit like Photoshop bevel and emboss, but also with rounded corners. At the moment I have a container outside the button which has the border on it, and inside I’m using RawMaterialButton
. The code for the container is like this:
Container(
BoxDecoration(
border: Border(
left: BorderSide(
color: Colors.black,
width: 1.0,
),
top: BorderSide(
color: Colors.black,
width: 1.0,
),
),
),
)
How can I make the corners for this border/container rounded?
Like this but with rounded corners:
2
Answers
This is not a 100% working solution. I just wrote some Path functions to draw all the sides using
CustomPainter
.RoundedChiseledBorder
RoundedBorderPainterBorder
USAGE
To use it just call
Ajil’s solution looks like the right direction to go. You are right though, it’s an amazing amount of work for such a small thing.
Here is my tedious effort, it needs to be simplified to tidy it up but it produces a more accurate representation of your image.