flet icon indicating copy to clipboard operation
flet copied to clipboard

Update Flet Mobile App SDK

Open yunguangli opened this issue 1 year ago • 2 comments

Description

I am testing the Dropdown control. The on_click event in option works properly on desktop if run like : flet run test.py -r -d ... However, there is no response on the Flet App on ios/android , if run like this : flet run test.py -r -d --ios or --android.

edited: found additional problem, bgcolor also doesn't work on Flet App. On the App, the dropdown bgcolor is always white. bgcolor works on desktop.

Code example to reproduce the issue:

import flet as ft

def main(page: ft.Page):
    def dropdown_changed(e):
        t.value = f"Dropdown changed to {e.control.data}"
        page.update()
   
    t = ft.Text()
    dd = ft.Dropdown(
        options=[
            ft.dropdown.Option("Red", data="Red", on_click=dropdown_changed),
            ft.dropdown.Option("Green", data="Green", on_click=dropdown_changed),
            ft.dropdown.Option("Blue", data="Blue", on_click=dropdown_changed),
         
        ],
        width=200,
bgcolor=ft.colors.BLUE,
    )
    page.add(dd, t)

ft.app(target=main)

Describe the results you received:

In Flet app on both ios and android, on_click and bgcolor has no response. It works, however, on desktop.

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:

Flet app on ios and android

Additional environment details:

yunguangli avatar Apr 25 '24 06:04 yunguangli

The Flet app needs to be updated (is in process).

ndonkoHenri avatar Apr 25 '24 11:04 ndonkoHenri

@ndonkoHenri I am also having a problem when I want to display local images on iOS, similar to the issue #3037 for Android.

File System structure:

project
  |-- assets
     |-- images
        |-- img.jpg
  |-- main.py

Code in main.py:


def main(page: ft.Page):
    page.add(ft.Image(src=f'images/img.jpg'))   # Doesn't work with: page.add(ft.Image(src=f'./images/img.jpg')) as well


ft.app(target=main, assets_dir='assets')

Images display on Desktop and Web, but doesn't on iOS. It doesn't work when setting img_src for Container as well.

Flet App info: Clinet version: 1.5.1 Flet SDK version; 0.21.1 Python version: 3.11.6

pip list

Package               Version
--------------------- --------------
annotated-types       0.7.0
anyio                 4.4.0
arrow                 1.3.0
binaryornot           0.4.4
certifi               2024.6.2
chardet               5.2.0
charset-normalizer    3.3.2
click                 8.1.7
cookiecutter          2.6.0
dnspython             2.6.1
email_validator       2.1.1
exceptiongroup        1.2.1
fastapi               0.111.0
fastapi-cli           0.0.4
flet                  0.22.1
flet-core             0.22.1
flet-runtime          0.22.1
h11                   0.14.0
httpcore              1.0.5
httptools             0.6.1
httpx                 0.27.0
idna                  3.7
Jinja2                3.1.4
markdown-it-py        3.0.0
MarkupSafe            2.1.5
mdurl                 0.1.2
oauthlib              3.2.2
orjson                3.10.5
packaging             23.2
pip                   24.0
pydantic              2.7.4
pydantic_core         2.18.4
Pygments              2.18.0
pypng                 0.20220715.0
python-dateutil       2.9.0.post0
python-dotenv         1.0.1
python-multipart      0.0.9
python-slugify        8.0.4
PyYAML                6.0.1
qrcode                7.4.2
repath                0.9.0
requests              2.32.3
rich                  13.7.1
setuptools            68.2.0
shellingham           1.5.4
six                   1.16.0
sniffio               1.3.1
starlette             0.37.2
text-unidecode        1.3
typer                 0.12.3
types-python-dateutil 2.9.0.20240316
typing_extensions     4.12.2
ujson                 5.10.0
urllib3               2.2.1
uvicorn               0.30.1
uvloop                0.19.0
watchdog              4.0.1
watchfiles            0.22.0
websockets            12.0
wheel                 0.41.2

aurosevic avatar Jun 15 '24 17:06 aurosevic

Are there new flet app?

BrentHuang avatar Jul 08 '24 08:07 BrentHuang

img_v3_02ck_a828fc36-bef2-4065-aff4-ee483c5064dg You can add a QR code scanning button on this interface. Scan the QR code displayed by flet run --android .

BrentHuang avatar Jul 09 '24 08:07 BrentHuang

I just installed version 0.24.1 of Flet and I still get the message "Unknown control: map" on my mobile. Do you have a target date for the availability of this feature on mobiles?

Michel7GitHub avatar Sep 06 '24 12:09 Michel7GitHub

The Flet app has been updated in both stores:

  • Google Playstore: https://play.google.com/store/apps/details?id=com.appveyor.flet
  • Apple AppStore: https://apps.apple.com/us/app/flet/id1624979699?platform=iphone

They are compatible with the latest Flet version 0.24.1. Give it a try and provide feedback.

ndonkoHenri avatar Sep 06 '24 14:09 ndonkoHenri

Hi, Unfortunately, I still have the same problem. The Map still does not display and I receive the message "Unknown control: map". I updated Flet App on my 2 mobiles (iPhone & iPad) and I have the problem with both.

Le ven. 6 sept. 2024 à 10:59, TheEthicalBoy @.***> a écrit :

The Flet app has been updated in both stores:

  • Google Playstore: https://play.google.com/store/apps/details?id=com.appveyor.flet
  • Apple AppStore: https://apps.apple.com/us/app/flet/id1624979699?platform=iphone

They are compatible with the latest Flet version 0.24.1. Give it a try and provide feedback.

— Reply to this email directly, view it on GitHub https://github.com/flet-dev/flet/issues/3096#issuecomment-2334248541, or unsubscribe https://github.com/notifications/unsubscribe-auth/A7MAAYSSDIRIRS647DKD5U3ZVG7LZAVCNFSM6AAAAABGYHAVOOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMZUGI2DQNJUGE . You are receiving this because you commented.Message ID: @.***>

Michel7GitHub avatar Sep 06 '24 15:09 Michel7GitHub

Sorry about that! Apparently, Flet client doesn't include map module. Will fix it in the next update.

FeodorFitsner avatar Sep 06 '24 15:09 FeodorFitsner

please let me know which version of google api you used and any other configuration

piidus avatar Sep 07 '24 14:09 piidus

Flet app has been updated in both stores.

FeodorFitsner avatar Sep 08 '24 00:09 FeodorFitsner

It works ! Awesome !

Michel7GitHub avatar Sep 08 '24 02:09 Michel7GitHub

What about the problem of images not displaying on IOS. I have the same problem on my iPhone & iPad. In my Windows 11 development environment, everything works very well. My Flet App version on mobiles is v0.24.1 and as the same on Windows. I tried many different tests with/without "assets_dir". Made my tests with that code:

import flet as ft
def main(page: ft.Page):
    page.add( 
        ft.Image(src="camera.svg", width=150, height=150),
        ft.Text("Hello World")
    )
ft.app(target=main, assets_dir="assets")

Michel7GitHub avatar Sep 09 '24 00:09 Michel7GitHub

What about the problem of images not displaying on IOS. I have the same problem on my iPhone & iPad. In my Windows 11 development environment, everything works very well. My Flet App version on mobiles is v0.24.1 and as the same on Windows. I tried many different tests with/without "assets_dir". Made my tests with that code:

import flet as ft
def main(page: ft.Page):
    page.add( 
        ft.Image(src="camera.svg", width=150, height=150),
        ft.Text("Hello World")
    )
ft.app(target=main, assets_dir="assets")

Same issue for me on Android. Works fine on desktop operating systems, but the image never shows on the mobile side. I'm running the latest version of the app and flet 0.24.1

cognimoto avatar Sep 10 '24 14:09 cognimoto