Skip to content
Discussion options

You must be logged in to vote

Correct me if I'm wrong, you want the navigation_bar to render the Control that corresponds to the selected_index instead of merely highlighting the selected_index?

If that's the case, how about you invoke a synthetic event, meaning, programmatically call it's on_change event handler?

Here's the code:

import flet as ft


def main(page: ft.Page):
    page.title = "Headspace clone"

    def change_content(e):
        page.controls.clear()
        nav_dest = e.control.selected_index

        if nav_dest == 0:
            nav_content = ft.Container(
                content=ft.Text(value="Today")
            )
            page.add(nav_content)

        if nav_dest == 1:
            nav_content = 

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
2 replies
@Dekubaka
Comment options

@Dekubaka
Comment options

Comment options

You must be logged in to vote
4 replies
@thetrotfreak
Comment options

@Dekubaka
Comment options

@thetrotfreak
Comment options

@Dekubaka
Comment options

Answer selected by Dekubaka
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants