flet-dev / flet

Flet enables developers to easily build realtime web, mobile and desktop apps in Python. No frontend experience required.
https://flet.dev
Apache License 2.0
9.43k stars 360 forks source link

image_src in Container doesn't work in 0.22 #3143

Closed yunguangli closed 2 weeks ago

yunguangli commented 2 weeks ago

Description Use image_src to set a container's background image doesn't work anymore in Flet 0.22. It worked in 0.20.
Neither local image nor online image works.

Code example to reproduce the issue:

import flet as ft

def main(page: ft.Page):
    bg = ft.Container(image_src="https://picsum.photos/200/2001")
    # bg = ft.Container(content=ft.Image(src="/images/black_bishop.png"))
    # bg = ft.Container(content=ft.Image(src="https://picsum.photos/200/2001"))
    page.add(bg)

ft.app(main)

Describe the results you received:

Describe the results you expected:

Additional information you deem important (e.g. issue happens only occasionally):

Flet version (pip show flet):

0.22

Give your requirements.txt file (don't pip freeze, instead give direct packages):

(The requirements)

Operating system:

Additional environment details: