fix: bottom navbar first item icon color not changing on primary color change

This commit is contained in:
Kingkor Roy Tirtho 2023-03-24 20:13:39 +06:00
parent 7a0fd64cf9
commit 6eb4244f32

View File

@ -57,9 +57,12 @@ class SpotubeNavigationBar extends HookConsumerWidget {
buttonBackgroundColor: buttonColor, buttonBackgroundColor: buttonColor,
color: theme.colorScheme.background, color: theme.colorScheme.background,
height: 50, height: 50,
items: [ animationDuration: const Duration(milliseconds: 350),
...navbarTileList.map( items: navbarTileList.map(
(e) { (e) {
/// Using this [Builder] as an workaround for the first item's
/// icon color not updating unless navigating to another page
return Builder(builder: (context) {
return MouseRegion( return MouseRegion(
cursor: SystemMouseCursors.click, cursor: SystemMouseCursors.click,
child: Badge( child: Badge(
@ -67,13 +70,13 @@ class SpotubeNavigationBar extends HookConsumerWidget {
label: Text(downloadCount.toString()), label: Text(downloadCount.toString()),
child: Icon( child: Icon(
e.icon, e.icon,
color: theme.colorScheme.primary, color: Theme.of(context).colorScheme.primary,
), ),
), ),
); );
}, });
), },
], ).toList(),
index: insideSelectedIndex.value, index: insideSelectedIndex.value,
onTap: (i) { onTap: (i) {
insideSelectedIndex.value = i; insideSelectedIndex.value = i;