0

I want to achieve ribbon style around widgets.

Hey guys, do anyone have any idea on how to implement this kind of style around a widget in flutter. Is there any available package for this?

enter image description here

Thanks!

BHARATH T
  • 501
  • 2
  • 5

1 Answers1

0

I found a package that has something similar https://pub.dev/packages/floating_ribbon. But, I think it's not hard to implemented yourself. You will need Stack where the ribbon will be placed on top of your widget. You can use also Positioned to place the ribbon exactly where you want on top of your widget.

A.Ktns
  • 381
  • 6
  • 12
  • Hey thanks. But the text inside the ribbon could have more than 1 line. So i could not use just image. The size of the ribbon needs to be dynamic. Also this package widget is not as my requirement. Thanks! – BHARATH T Dec 01 '22 at 06:40
  • Personally, I don't think is a good idea to have dynamic ribbon size. You don't want a ribbon to be huge and cover, let's say, a big part of your background Widget. Are you going to use it in a list with many similar ribbon widgets? Maybe is better to have a constant ribbon size and change dynamically the font size when the text is very long. – A.Ktns Dec 01 '22 at 08:38