0

I have cloned a project from github, it is working perfectly fine. The two issues I have is -

  1. Whenever I put a print statement it warns me saying - Avoid Print calls in production code

  2. The second one, it warns me about adding const to widgets. Why would I need to append const to widgets? I know there is avoid statement that you can put in on top to get rid of these warnings, but I would like to know why there is a warning. Example below -

    children: [
       const Text('Sign in with your phone number below'),
       const SizedBox(height: 18),
    ]
    

Could someone explain how to change this project from release mode to debug mode?

Sumchans
  • 3,088
  • 6
  • 32
  • 59

1 Answers1

2

1 - instead of print statement put 'debugPrint(data)'. more info here. 2 - const improves performance a bit and enhances the work need to be done by the garbage collector.

for more information you can reference to this post.

Benyamin
  • 1,008
  • 11
  • 18