indentLevel property

int get indentLevel

Current indentation depth. Each level is two spaces.

Per-zone when tasks run in parallel: a shared counter would be incremented by one task while another was writing, and every line would come out at the wrong depth.

Implementation

static int get indentLevel =>
    (Zone.current[_zoneIndent] as _Counter?)?.value ?? _indentLevel;
set indentLevel (int value)

Implementation

static set indentLevel(int value) {
  final scoped = Zone.current[_zoneIndent] as _Counter?;
  if (scoped != null) {
    scoped.value = value;
  } else {
    _indentLevel = value;
  }
}