Replies: 1 comment 1 reply
-
Could you please provide more completer code example? In general, it does "smell" already when you need to pass "page" around or inside custom controls. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We have a Navigation Bar that need to be displayed in many pages, we created a class for that navigation bar with passing parameters for pages, inside the class we have also the destinations function that take e parameter,
Navigation Bar is displayed properly when we call it, but changing destinations is not working when as the page parameter is showing that is nonetype (we can not call the page variable in that NavigationBar class)
class NavBar():
def __init__(self):
......
def navbar(self,page):
navbar = ft.NavigationRail(......,on_change= lambda e: self.change_destination(e,page))
return navbar
def change_destination(self,e,page):
.....
in Page (another file) we are calling that navbar:
nv = NavBar()
navbar = nv.navbar(self.page)
then we are displaying the navigation bar, it is working properly, but when we try to change destination, that parameter page is showing as NoneType, any one faced this issue ?
Flet version (
pip show flet
):0.10.3
Beta Was this translation helpful? Give feedback.
All reactions