Debug flutter app

If you want to remove something from code in flutter in different modes you have different constants:

  • kDebugMode – true if app is in debug mode otherwise false
  • kReleaseMode – true if app is in release mode otherwise false
  • kProfileMode – true if app is in profile mode otherwise false

And then you can use it like that:

if (kDebugMode) {
   // some code
}

so compiler remove this unused code in other modes.

Leave a comment

Your email address will not be published. Required fields are marked *