-
QuestionHi, maybe doing something wrong. Not able to set color on selected index in my NavigationBar. Had no problem in CupertinoNavigationBar. Is it not supported or am I doing something wrong? Code samplepage.navigation_bar = ft.NavigationBar(
adaptive=True,
bgcolor=ft.colors.GREY_900,
indicator_color=ft.colors.LIGHT_GREEN, #ToDo this is not working
on_change=lambda e: print("Selected tab:", e.control.selected_index),
destinations=[
ft.NavigationBarDestination(icon=ft.icons.HOUSE, label="Hem"),
ft.NavigationBarDestination(icon=ft.icons.SHOPPING_CART, label="Butik"),
ft.NavigationBarDestination(icon=ft.icons.RECEIPT, label="Kvitton"),
ft.NavigationBarDestination(icon=ft.icons.SETTINGS, label="Inställningar"),
],
) Error messageNo response ------------------------------------------------------
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
I think that all looks ok. Have you got a minimal reproducible example? (simplest complete script that shows the issue) |
Beta Was this translation helpful? Give feedback.
-
@lennpet - I can replicate your issue on MacOS when running Flet latest (0.24.1) and 0.23.1. I think this should work.. I've had a look over the Dart code and I am unsure why, it should just switch to the Cupertino control and return that (which you say is working). I'd raise an issue for it. You seem to have already figured out a solution, but yes - I'd create a custom control and have two routes, Else dont Dump in the kwargs to each respectively.
|
Beta Was this translation helpful? Give feedback.
-
Should be getting deeper into the code but for me it seems that in cupertino_navigation_bar.dart, when creating the CupertinoTabBar, the activeColor is set as attribute 'activeColor' - but I can't se how that is matched with indicator_color that I set in code for the NavigationBar. Something is missing. Or? |
Beta Was this translation helpful? Give feedback.
@lennpet - I can replicate your issue on MacOS when running Flet latest (0.24.1) and 0.23.1.
I think this should work.. I've had a look over the Dart code and I am unsure why, it should just switch to the Cupertino control and return that (which you say is working).
I'd raise an issue for it.
You seem to have already figured out a solution, but yes - I'd create a custom control and have two routes,
if system == Darwin/iOS
return Curpurtino
Else dont
Dump in the kwargs to each respectively.