debug method

void debug([
  1. String? tag
])

Prints this value to the debug console with an optional tag.

The output is colorized (white) for better readability in logs. If FlutterExtended.debugFlag is provided, it is prepended.

Example:

user.debug('UserState');

Implementation

void debug([String? tag]) {
  final flag = FlutterExtended.debugFlag;
  final flagPrefix = flag != null && flag.isNotEmpty ? '[$flag]' : '';
  debugPrint('\x1B[37m$flagPrefix[${tag ?? runtimeType}] $this\x1B[0m');
}