Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Dropdown.expanded_insets has no effect

Chiusa Adatta ai principianti
#6,895 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Una pull request collegata è già stata integrata.

  • #6896 di @xsalaices — integrata

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
88/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
dart, flutter, python
Ambito
frontend

Direzione di ricerca

Inizia in packages/flet/lib/src/controls/dropdown.dart, in corrispondenza del calcolo di expandedInsets, e confrontalo con la dichiarazione Python in sdk/python/packages/flet/src/flet/controls/material/dropdown.py:181. Verifica l'esempio fornito con expand=True, quindi conferma che il client Flutter utilizzi gli inset configurati quando presenti e mantenga inset pari a zero quando non lo sono; l'esempio non dovrebbe più ignorare expanded_insets.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug controls
Description

ft.Dropdown.expanded_insets is declared and documented in the Python SDK, but the Flutter client never reads it, so setting it has no effect.

  • Python: expanded_insets: Optional[PaddingValue] = None ("The insets for the expanded dropdown menu"), in sdk/python/packages/flet/src/flet/controls/material/dropdown.py:181
  • Dart: packages/flet/lib/src/controls/dropdown.dart:229 derives expandedInsets only from expand:
    EdgeInsets? expandedInsets = expand > 0 ? EdgeInsets.zero : null;
    
    It then passes that value to DropdownMenu(expandedInsets: ...) at line 253. There is no control.get...("expanded_insets") anywhere in the client.
Code example to reproduce
import flet as ft

def main(page: ft.Page):
    page.add(
        ft.Row(
            [
                ft.Dropdown(
                    expand=True,
                    expanded_insets=ft.Padding.symmetric(horizontal=40),
                    options=[ft.DropdownOption(key="a", text="A")],
                )
            ]
        )
    )

ft.run(main)
Expected behavior

With expand=True, the dropdown field is inset from its parent's edges by expanded_insets, as in Flutter's DropdownMenu.expandedInsets.

Actual behavior

The dropdown always fills its parent with zero insets (EdgeInsets.zero whenever expand is set). expanded_insets is ignored.

Suggested fix

In dropdown.dart, when expand > 0, use the parsed expanded_insets padding if it's set, otherwise EdgeInsets.zero. Or remove the property from the Python API if it isn't meant to be supported.

Flet version

1.0.1. Checked against main at 8ab92fbb.

Found while verifying Flet UI behaviour for the flet-ui-tricks agent skill.

Lingua principale
Python
Stelle
17.3k
Fork
723
Merge medio
1g 11h
PR unite (30g)
56

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di flet-dev/flet

Tutte le issue di flet-dev/flet

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.