writeScoped method

void writeScoped(
  1. String? begin,
  2. String end,
  3. Function func, {
  4. bool addTrailingNewline = true,
})

Like addScoped but writes the current indentation level.

Implementation

void writeScoped(
  String? begin,
  String end,
  Function func, {
  bool addTrailingNewline = true,
}) {
  assert(begin != '' || end != '',
      'Use nest for indentation without any decoration');
  addScoped(str() + (begin ?? ''), end, func,
      addTrailingNewline: addTrailingNewline);
}