I am adding a theme to the title in BottomNavigationBarItem and I receive the error "Invalid constant value".
I know that it is not the type of theme I am using because I was able to divide my theme method and use the individual constants in the following BottomNavigationBarItem. Hmmm, I was going to post an image that shows exactly what I want to say here, but I guess I still can't.
This is the code that tells me that I have invalid constant values
title: Text('Event', style: Theme.of(context).textTheme.button),
This code is where I added the constant values directly to the style from my buttonTheme method on my style page
title: Text('Match Details', style: TextStyle(fontFamily: montserratFont, fontSize: smallTextSize, color: textColorLight)),
These are the constant values and the theme of the style page button
const smallTextSize = 14.0;
const Color buttonTextColour = Color(0xffdc0000);
const String montserratFont = 'Montserrat';
const buttonTextStyle = TextStyle(
I noticed in the flutter code that BottomNavigationBarItem is a constant and I thought this could be the problem
}) : activeIcon = activeIcon ?? icon,
assert(icon != null);
but then I noticed that so is RaisedButton, but it doesn't affect me to add a theme.
@required VoidCallback onPressed,
If there is another way to use the theme with the title in NavigationBarItem, I would appreciate it if someone could point it out. I'd rather not have to fear the entire Buttom navigation bar.