I have a short question. I\'m looking for a way to execute code in Flutter when the app is in Debug mode. Is that possible in Flutter? I can\'t seem to find it anywhere in t
Extracted from Dart Documentation:
When exactly do assertions work? That depends on the tools and framework you’re using:
- Flutter enables assertions in debug mode.
- Development-only tools such as dartdevc typically enable assertions by default.
- Some tools, such as dart and dart2js, support assertions through a command-line flag: --enable-asserts.
In production code, assertions are ignored, and the arguments to assert aren’t evaluated.