withStyle static method

void withStyle(
  1. VariableStyle style,
  2. void action()
)

Calls action in a Zone that has it's format variable style set to style.

Implementation

static void withStyle(VariableStyle style, void Function() action) {
  runZoned(() {
    action();
  }, zoneValues: {'console.format.variable_style': style});
}