What is the reason for the blue underline? Flutter
1,042
It's a linter warning. Usually it tells you about the best practices that can improve your code quality.
In this case, it is asking you to use const keyword for those widgets while initialising. The exact rule for this warning can be found here: prefer_const_constructors.
You can check all the linter rules here
Author by
praw
Updated on January 01, 2023Comments
-
praw over 1 year
Does anyone know the reason for the blue lines??
When I double the size variable, the blue underlines turn into red underlines.
-
Midhun MP over 2 yearsIt's from linter. It suggests you to add const keyword for those widgets.
-
praw over 2 yearsDo classes have to be const? i am new to this language. When I don't const the classes the app works but the blue underlines are annoying
-
Midhun MP over 2 yearsCheck this answer to get an idea about use of const: stackoverflow.com/questions/51576209/…
-
-
praw over 2 yearsThanks for the info, I'm new so I couldn't rate your answer