flet icon indicating copy to clipboard operation
flet copied to clipboard

NavigationDrawerDestination label color changed don't work

Open burhansvural opened this issue 7 months ago • 0 comments

Duplicate Check

  • [X] I have searched the opened issues and there are no duplicates

Describe the bug

look at the my sending code... theme1 It should work like this but it doesn't work! Delete the label_text_style property, other properties and their assigned values ​​always work. When I assign a value to the label_text_style property, everything on the screen becomes invisible but values ​​assigned to other properties work normally.

Code

import flet as ft


def home(page: ft.Page):
    theme1 = ft.Theme(
        navigation_drawer_theme=ft.NavigationDrawerTheme(
            label_text_style={
                ft.ControlState.HOVERED: ft.TextStyle(color=ft.colors.WHITE),
                ft.ControlState.FOCUSED: ft.TextStyle(color=ft.colors.YELLOW),
                ft.ControlState.DEFAULT: ft.TextStyle(color=ft.colors.BLUE),
            },
            bgcolor=ft.colors.GREEN,
            shadow_color=ft.colors.BLUE_ACCENT_700,
            elevation=16,
            indicator_color=ft.colors.RED,
            indicator_shape=ft.RoundedRectangleBorder(radius=10),
            surface_tint_color=ft.colors.AMBER,
            tile_height=120
        )
    )
    page.theme = theme1

    drawer = ft.NavigationDrawer(
        controls=[
            ft.Container(height=12),
            ft.NavigationDrawerDestination(
                label="Item 1",
                icon=ft.icons.DOOR_BACK_DOOR_OUTLINED,
                selected_icon_content=ft.Icon(ft.icons.DOOR_BACK_DOOR),
            ),
            ft.Divider(thickness=2),
            ft.NavigationDrawerDestination(
                icon_content=ft.Icon(ft.icons.MAIL_OUTLINED),
                label="Item 2",
                selected_icon=ft.icons.MAIL,
            ),
            ft.NavigationDrawerDestination(
                icon_content=ft.Icon(ft.icons.PHONE_OUTLINED),
                label="Item 3",
                selected_icon=ft.icons.PHONE,
            ),
        ],
    )

    page.add(
        ft.SafeArea(
            content=ft.Column(
                controls=[
                    ft.Container(
                        content=ft.Row(
                            controls=[
                                ft.IconButton(
                                    icon=ft.icons.MENU,
                                    on_click=lambda e: page.open(drawer),
                                ),
                                ft.Text(
                                    "Casa del Rey de la Gloria",

                                ),
                                ft.IconButton(
                                    icon=ft.icons.SEARCH,
                                    # on_pressed=lambda: page.open_drawer(),
                                ),

                            ],
                            alignment=ft.MainAxisAlignment.SPACE_BETWEEN,
                            expand=True

                        ),

                    ),
                    ft.Container()
                ],
                alignment=ft.MainAxisAlignment.CENTER,
                horizontal_alignment=ft.CrossAxisAlignment.CENTER,
                spacing=20,
                expand=True
            ),
        )
    )


if __name__ == "__main__":
    ft.app(target=home, assets_dir="assets")

To reproduce

no error message appears.

Expected behavior

No response

Screenshots

No response

Operating System

Linux

Operating system details

Debian 12

Flet version

0.23.1

Regression

I'm not sure / I don't know

Suggestions

No response

Additional details

No response

burhansvural avatar Jun 25 '24 01:06 burhansvural