Skip to content

bug: Unable to see navigation bar #6322

@Vulturu1

Description

@Vulturu1

Duplicate Check

Describe the bug

I have a very simple root logic to control the content on my screen.

I have my root page and I navigate between pages using the push_route coroutine. However despite setting a navigation bar for my page, it does not appear on the screen. The only way I can get it to display is to manually assign it to each view. This is not ideal however as it is not code efficient and also causes the navigation bar to animate with the changing views.

I am not entirely sure why this is happening since I used the navigation bar property in the past with a container added to the page which would have its content swapped out to navigate between pages, but when switching over to using the Views in Flet, the issue arises.

Code sample

Code
import flet as ft

class Basic(ft.View):
    def __init__(self):
        super().__init__()
        self.route = '/basic'
        
        self.content = ft.Text('HELLO')
        
def main(page: ft.Page):
    
    async def change_page():
        await page.push_route('/basic')
        
    change_page()
    page.navigation_bar = ft.NavigationBar()
    
ft.app(main)
This code is an extremely simplified version which only mirrors the code structure in my actual file. If this setup does not cause issues when run, then it may be something else on my end however this is how my page haandles pages.

To reproduce

  1. Run
  2. nav bar not visible
  3. cry

Expected behavior

Navigation bar should overlay views

Screenshots / Videos

Captures

[Upload media here]

Operating System

Windows

Operating system details

Windows 10

Flet version

0.82.2

Regression

I'm not sure / I don't know

Suggestions

No response

Logs

Logs
[Paste your logs here]

Additional details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions