Closed Deepanshu-Rohilla closed 2 years ago
@Deepanshu-Rohilla I have the same problem. Have you fixed your problem or switched BottomNavBars? @rafalbednarczuk It is possible to change colors when using a provider but it seems not to work for the items. Is this intended behaviour?
@MiroLiebschner . It somehow worked when I implemented "multiple possible accent colour" option in my app (similar to telegram) Here's the link to PR: https://github.com/devclub-iitd/ShareACab/pull/141 I don't exactly know the source of bug and how is it coming
Same problem here
Same behaviour too.
See PR #118, hopefully @rafalbednarczuk will merge PR changes soon
Best solution for now is to clone/add as submodule to your project, specify the path and make sure the version in Cache\hosted\pub.dartlang.org
is removed (I found it sometimes doesn't use the updated "local" path)
fixed in 1.0.2, please update curved_navigation_bar in pubspec.yaml to 1.0.2
Not working in 1.0.3
Not working in 1.0.3
I'm using 1.0.2 to work
Yep still not working in 1.0.3
Until better solution, here is a fix:
ThemeData? _themeData;
// on theme change
@override
void didChangeDependencies() {
super.didChangeDependencies();
final ThemeData newThemeData = Theme.of(context);
if (_themeData == null ) {
_themeData = newThemeData;
_onThemeChanged(newThemeData);
}
}
void _onThemeChanged(ThemeData themeData) {
print('Theme changed to: ${themeData.brightness == Brightness.dark ? "Dark" : "Light"}');
int savedIndex = _selectedIndex;
setState(() {
_selectedIndex = savedIndex > 0 ? 0 : 1;
});
Future.delayed(const Duration(milliseconds: 10), () {
setState(() {
_selectedIndex = savedIndex;
});
_themeData = null;
});
}
Focus on the Home icon after the theme is changed.
Here's the code of switch (used to change the theme):
theme notifier and dark theme is initialised as :
And this is the code for CurvedNavigationBar: