Dropdown(expand=True) silently breaks rendering of entire widget subtree on Android (Flutter mobile)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 55/100
Direzione di ricerca
Inizia con la riproduzione ft.app fornita e verifica il sottoalbero ad altezza zero su Android, quindi confrontalo con il comportamento su desktop. Traccia come viene gestito Dropdown(expand=True) attraverso la catena di layout mobile di Flutter, soprattutto all’interno di ListView e Column. Il lavoro è completato quando Card e il relativo Dropdown vengono renderizzati all’altezza intrinseca su Android senza compromettere il sottoalbero circostante, mentre il comportamento del workaround rimane intatto.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
When ft.Dropdown(expand=True) is placed inside a layout chain of Column → Card → ListView(expand=True) (which in turn sits inside an AnimatedSwitcher(expand=True) or similar expanding ancestor), the entire widget subtree fails to render on Android. On desktop (Flets own engine / Linux/Windows) it works fine — the Dropdown clamps to its intrinsic height and the rest of the tree renders normally.
No error or exception is raised in Python — the page.update() succeeds silently. The Flutter layout pass simply collapses the whole subtree to zero height.
To Reproduce
import flet as ft
def main(page: ft.Page):
page.add(
ft.SafeArea(
expand=True,
content=ft.Column([
ft.Text("Top bar"),
ft.Container(
expand=True,
content=ft.ListView(
expand=True,
controls=[
ft.Card(
content=ft.Container(
padding=15,
content=ft.Column([
ft.Text("Card title", size=18, weight=ft.FontWeight.BOLD),
ft.Dropdown(
expand=True, # ← THIS LINE CAUSES THE BUG
options=[
ft.dropdown.Option("a", "Option A"),
ft.dropdown.Option("b", "Option B"),
],
),
])
)
)
]
)
)
], spacing=0)
)
)
ft.app(target=main)
Result on Android: The screen shows only "Top bar" — the entire Container/ListView/Card below it is invisible (zero-height).
Expected: The Card should render with the Dropdown at its intrinsic height, same as on desktop.
Workaround
Remove expand=True from the Dropdown (or any nested Dropdown inside an expanding scrollable):
ft.Dropdown( # no expand=True
options=[...]
)
Environment
- Flet version: 0.86.1 (also affects 0.28+ — likely all versions)
- Platform: Android (Flutter mobile engine)
- Desktop: works correctly on Linux, Windows, macOS
Root Cause (educated guess)
On desktop, Flutters layout engine clamps unbounded expand requests from a Dropdown to its intrinsic height. On mobile (Android Flutter), the same unconstrained height propagates upward and causes the layout to resolve the entire branch to zero height — effectively a silent layout failure with no error surface shown to the user or the developer.
This is related to how Flutter handles double.infinity constraints inside a Column when a child requests expand=True without an intrinsic size limit. Dropdown is a FormFieldControl whose intrinsic height is finite, but the expand=True flag may bypass that and push infinite height to the parent Column, which cascades up through Card → ListView.
Suggested Fix
Dropdown(expand=True) should clamp to its intrinsic height rather than propagating unconstrained height, or the Flet framework should warn at the Python level when Dropdown (or similar intrinsic-sized controls) is given expand=True inside a scrollable parent.
- Lingua principale
- Python
- Stelle
- 17.1k
- Fork
- 708
- Merge medio
- 1g 17h
- PR unite (30g)
- 46
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di flet-dev/flet
-
bug controls
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
bug: Interactive Viewer renders grey text when passed alignmentForse già presa @ndonkoHenri l’ha presa 7 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
flet-dev/flet#6744 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
feature request
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di flet-dev/flet
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
BasedHardware/omi#20271 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 92/100
openai/openai-cookbook#3153 ·
I maintainer di solito rispondono entro 1 giorno
-
cvss-severity:high devguard l3montree-cybersecurity/devguard/devguard pkg:golang/github.com/l3montree-dev/devguard risk:low state:open
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
l3montree-dev/devguard#3146 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
bug confirmed issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
open-webui/open-webui#31849 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno