My code keeps giving me a warning...
Avoid print calls in production code.
How do I resolve it?
Use debugPrint instead. Just know that debugPrint can only take a String? so you might need to use toString() or correctly format the data you are trying to display.
import 'package:flutter/foundation.dart';
debugPrint('This is a debugPrint');
You can use print statement in only debug mode when app run in release mode print statement avoid. Write print using below both method:-
import 'package:flutter/foundation.dart';
if (kDebugMode) {
print("Hello");
}
OR
debugPrint('This is a debugPrint');
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