material-foundation/flutter-packages

[dynamic_color] Release build prints "Accent color detected." in console

PeterNjeim opened this issue · 1 comments

Package

dynamic_color

Existing issue?

What happened?

Expected vs actual result:

Expectation: nothing printed to console
Actuality: flutter: dynamic_color: Accent color detected. printed to console

Steps to reproduce:

  1. Use DynamicColorBuilder
  2. Build Linux release application
  3. Run binary

Notes

From this line in the code:

debugPrint('dynamic_color: Accent color detected.');
While it may seem like it does, debugPrint doesn't mean "print only in debug mode", it means it "throttles the output to a level that avoids being dropped by Android’s kernel." Best practice is not to include prints in production in code, so I recommend deleting the lines that use debugPrint in the dynamic_color package, and possibly all non-error prints in the repository (maybe change this line:
avoid_print: false
to true to make it easier).

Relevant log output

No response

Yeah, you would think debugPrint only prints in debug mode. Easy fix