<p>I've got this problem while trying the below code.</p> <p>First of all this is not an error, and your program should work fine without resolving it too. But, no one likes to see some squiggly lines in their programs, right?</p> <p>However, the reason it occurred, is that all the widgets inside the List are immutable. Hence it suggests adding the const keyword in one place.</p> <p>In order to fix this issue, I have changed it as shown below.</p> <p>Hope this is helpful.</p> <p>Thanks,Srikanth</p>
Prefer const literals as parameters of constructors on @immutable classes.
This Article is posted by seven.srikanth at 11/26/2022 2:14:42 AM
Check out our other latest articles
Safearea widget - How to avoid visual overlap with Notch on flutter mobile app?How to convert row of widgets into column of widgets in flutter based on screen size?
How to run Flutter programs from GitHub?
How to get screen orientation in flutter?
NavigationRail example in flutter
Tags: flutter constant;
Check out our other latest articles
Safearea widget - How to avoid visual overlap with Notch on flutter mobile app?How to convert row of widgets into column of widgets in flutter based on screen size?
How to run Flutter programs from GitHub?
How to get screen orientation in flutter?
NavigationRail example in flutter