flet-dev / flet

Flet enables developers to easily build realtime web, mobile and desktop apps in Python. No frontend experience required.
https://flet.dev
Apache License 2.0
9.59k stars 372 forks source link

Add `dropdown.Option.text_style` property #3293

Closed ndonkoHenri closed 1 week ago

ndonkoHenri commented 2 weeks ago

Test Code

import flet as ft

def main(page: ft.Page):
    page.add(
        ft.Dropdown(
            width=100,
            options=[
                ft.dropdown.Option(
                    "Red",
                    text_style=ft.TextStyle(color=ft.colors.RED, italic=True),
                    disabled=True,
                ),
                ft.dropdown.Option(
                    "Green", text_style=ft.TextStyle(color=ft.colors.GREEN, italic=True)
                ),
                ft.dropdown.Option("Blue", text_style=ft.TextStyle(color=ft.colors.BLUE)),
            ],
        )
    )

ft.app(target=main)