In the general ThemeData of my flutter app, I have the following code to give a general style to the NavigationBar.
This is the way to style the label under the icon within NavigationBarTheme, based on the doc.
In the class that handles the Navigation, so elsewhere in the app, I need to add color property to the TextStyle, maintaining the other properties via Theme.of(context).
But how can I do this with WidgetStateProperty.all?
Thanks in advance!
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(
navigationBarTheme: NavigationBarThemeData(
labelTextStyle: WidgetStateProperty.all(
const TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.w700,
letterSpacing: 1.0,
),
),
),
),
);
}
TextStyle(....,color?Theme.of(context).copyWith, but I don't know how to do it withWidgetStateProperty.allThemeDataor what?colortoTextStyleinsidelabelTextStyleThemeDatathen why are you usingNavigationBarThemeData?