0

I want to create the following label using Flutter. How do I go about doing this? enter image description here

Is there an Icon class that creates this kind of label?

mcfred
  • 1,183
  • 2
  • 29
  • 68
  • check this out : https://stackoverflow.com/questions/53929637/how-to-set-the-shape-of-a-button-with-conical-border/53931532#53931532 – Vamsi Krishna Feb 06 '19 at 11:59
  • Thanks. I was looking for a label instead of a button. How can I achieve that? – mcfred Feb 06 '19 at 12:21
  • @VamsiKrishna, I want the left part of the image you shared to look exactly the same as the right part. How do I achieve this using this code: path.lineTo(0.0, size.height); path.lineTo(arrowDepth, size.height / 2); path.close(); – mcfred Feb 06 '19 at 18:24

1 Answers1

0

You can use CustomClipper to clip your widget.

I have a package for that and you can find the LabelClipper here

Figen Güngör
  • 12,169
  • 14
  • 66
  • 108
  • Thanks. I want to display the ticket clipper and I added the following code SizedBox(height: 16.0), Ticket( radius: 30.0, child: Image.asset("lake.jpg"), ). Plus, why does the child contain an image instead of a text? – mcfred Feb 06 '19 at 18:21
  • child's type is Widget. So you can put any widget you like. – Figen Güngör Feb 06 '19 at 20:08
  • If I add new Text("Something"), only the text shows up. The shape doesnt show up at all – mcfred Feb 07 '19 at 06:43
  • You have to wrap your Text with a Container and give it a color and padding. It doesn't provide shapes.It just clips whatever you give to it. – Figen Güngör Feb 07 '19 at 07:13