Similar question here but I'm not sure how I can implement it in Flet. I need Result-1's fit but Result-2's border.
My code:
def build(self):
return ft.Container(
ft.Image(
src=self.imgPath,
fit=ft.ImageFit.COVER,
),
width=250,
height=250,
border_radius=ft.border_radius.all(20),
border = ft.border.all(2, 'grey'),
on_hover=self.mouse_hover,
)
Result:
Altered code:
def build(self):
return ft.Container(
ft.Image(
src=self.imgPath,
# fit=ft.ImageFit.COVER,
),
width=250,
height=250,
border_radius=ft.border_radius.all(20),
border = ft.border.all(2, 'grey'),
on_hover=self.mouse_hover,
)
Result:

