Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Same code shows different appearance in Flet APP/Web/PC local. #4855

Closed
1 task done
wzk0 opened this issue Feb 8, 2025 · 0 comments · Fixed by #4875
Closed
1 task done

Same code shows different appearance in Flet APP/Web/PC local. #4855

wzk0 opened this issue Feb 8, 2025 · 0 comments · Fixed by #4875
Assignees
Labels
bug Something isn't working controls
Milestone

Comments

@wzk0
Copy link

wzk0 commented Feb 8, 2025

Duplicate Check

Describe the bug

Recently I was developing an accounting software, here is part of issue code:

data_panel = ft.Card(color=ft.Colors.PRIMARY_CONTAINER, content=ft.Column(spacing=0, controls=[
                ft.ListTile(dense=True, visual_density=ft.VisualDensity.ADAPTIVE_PLATFORM_DENSITY, title=ft.Text(weight=ft.FontWeight.BOLD), leading=ft.Icon(), trailing=ft.Text(weight=ft.FontWeight.BOLD), subtitle=ft.Text()), 
                ft.ListTile(dense=True, visual_density=ft.VisualDensity.ADAPTIVE_PLATFORM_DENSITY, title=ft.Text(weight=ft.FontWeight.BOLD), leading=ft.Icon(), trailing=ft.Text(weight=ft.FontWeight.BOLD), subtitle=ft.Text()), 
                ft.ListTile(dense=True, visual_density=ft.VisualDensity.ADAPTIVE_PLATFORM_DENSITY, title=ft.Text(weight=ft.FontWeight.BOLD), leading=ft.Icon(), trailing=ft.Text(weight=ft.FontWeight.BOLD), subtitle=ft.Text()), 
                ft.ListTile(dense=True, visual_density=ft.VisualDensity.ADAPTIVE_PLATFORM_DENSITY, title=ft.Text(weight=ft.FontWeight.BOLD), leading=ft.Icon(), trailing=ft.Text(weight=ft.FontWeight.BOLD), subtitle=ft.Text(), on_long_press=update_source_dialog)
                ]))

but I encountered some problems during debugging:

I debugged it locally on my PC (python3 main.py), and the ListTile component seemed to cover the parent component Card (because Card did not display color). Then I planned to debug on Android (flet run --android), and found that it showed the effect I wanted in Flet APP (but the SegmentedButton component lost its border)

So here is the view on the PC (same on the Web or compiled apk):

Image

Here is the view on the Android Flet APP:

Image

I'm not sure if it's a problem with my code or with the new version of flet.

Code sample

Code
data_panel = ft.Card(color=ft.Colors.PRIMARY_CONTAINER, content=ft.Column(spacing=0, controls=[
                ft.ListTile(dense=True, visual_density=ft.VisualDensity.ADAPTIVE_PLATFORM_DENSITY, title=ft.Text(weight=ft.FontWeight.BOLD), leading=ft.Icon(), trailing=ft.Text(weight=ft.FontWeight.BOLD), subtitle=ft.Text()), 
                ft.ListTile(dense=True, visual_density=ft.VisualDensity.ADAPTIVE_PLATFORM_DENSITY, title=ft.Text(weight=ft.FontWeight.BOLD), leading=ft.Icon(), trailing=ft.Text(weight=ft.FontWeight.BOLD), subtitle=ft.Text()), 
                ft.ListTile(dense=True, visual_density=ft.VisualDensity.ADAPTIVE_PLATFORM_DENSITY, title=ft.Text(weight=ft.FontWeight.BOLD), leading=ft.Icon(), trailing=ft.Text(weight=ft.FontWeight.BOLD), subtitle=ft.Text()), 
                ft.ListTile(dense=True, visual_density=ft.VisualDensity.ADAPTIVE_PLATFORM_DENSITY, title=ft.Text(weight=ft.FontWeight.BOLD), leading=ft.Icon(), trailing=ft.Text(weight=ft.FontWeight.BOLD), subtitle=ft.Text(), on_long_press=update_source_dialog)
                ]))

To reproduce

As mentioned above.

Expected behavior

No response

Screenshots / Videos

Captures

[Upload media here]

Operating System

Linux

Operating system details

Ubuntu 24.04.1 LTS, Android 15

Flet version

0.26.0

Regression

No, it isn't

Suggestions

No response

Logs

Logs
[Paste your logs here]

Additional details

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working controls
Projects
Status: ✅ Done
2 participants