flet: Images no longer displaying on WebView
Description Images from assets are no longer being shown on the WebView when using 0.21.1 >
Code example to reproduce the issue:
import flet as ft
imgsrc='./assets/deaf918056f442f1be15fadf7553cd63.png'
def main(page):
imgObj=ft.Image(src=imgsrc)
img = ft.Container(content=ft.Row([imgObj,ft.Text('Image'),]), bgcolor="orange")
page.add(img)
ft.app(main, assets_dir='assets')
Describe the results you received: When running the app with; app = ft.app(target=main, assets_dir=‘assets’) then it gathers and displays the assets correctly but when running with app = ft.app(target=main, assets_dir=‘assets’, view=ft.WEB_BROWSER) or app = ft.app(target=main, assets_dir=‘assets’, export_asgi_app=True) then all images are not shown
This was not the case in <= 0.20
Describe the results you expected: Images to be shown as expected
Additional information you deem important (e.g. issue happens only occasionally):
Flet version (pip show flet
):
Name: flet
Version: 0.21.1
Summary: Flet for Python - easily build interactive multi-platform apps in Python
Home-page:
Author: Appveyor Systems Inc.
Author-email: hello@flet.dev
License: Apache-2.0
Location: C:\Users\kbaker\AppData\Local\Programs\Python\Python311\Lib\site-packages
Requires: cookiecutter, fastapi, flet-runtime, packaging, qrcode, uvicorn, watchdog
Required-by:
Operating system: Windows 11 23H2
Additional environment details:
About this issue
- Original URL
- State: open
- Created 4 months ago
- Comments: 15 (1 by maintainers)
Hello, I get the same problem. When I run the app with ft.app(main), it works. However, when I run the app with ft.app(target=main, view=ft.AppView.WEB_BROWSER), nothing is displayed.”