2

This is my image:

enter image description here

It's height is 8, but it's width is unknown, maybe 50, 100 or 200.

What I want is the image's left and right side are not stretched when it's width changed.

I use centerSlice but I don't clear it's value:

final bottomImage = Image.asset(
  ImageTool.findVariant(R.calendarMenuBottom),
  height: 8,
  fit: BoxFit.fill,

  //centerSlice: Rect.fromLTRB(10, 4, 10, 4),
);

How can I do it?

无夜之星辰
  • 5,426
  • 4
  • 25
  • 48
  • Check this answer for an explanation on how the centerSlice property works https://stackoverflow.com/a/63254849/948942 – Incinerator Feb 06 '23 at 13:32

0 Answers0