I have created a flutter application and added a custom theme data (themes.dart)
Now everything works fine when I run it but I keep getting the error (Name non-constant identifiers using lowerCamelCase.)
I'm not really sure why it is complaining even though the application runs on my device. How do I fix this issue?
class CustomColors {
// Must begin with lower-case character!
final NovaWhite = Color(0xffecf0f1);
}
ThemeData BaseThemeData() { // I get a complaint on BaseThemeData
final ThemeData base = ThemeData.light();
TextTheme _baseTextTheme(TextTheme base) {
return base.copyWith(
),
);
}
}
Name your variable like this
final novaWhite = Color(0xffecf0f1);
This was a stupid mistake on my part as I did not understand why Visual Code was complaining.
(Name non-constant identifiers using lowerCamelCase.) - simply meant that the identifiers should have begun with a lower-case character.
// Must begin with lower-case character!
final NovaWhite = Color(0xffecf0f1);
Thanks to Paulw11 for the help!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With