sectionArrows function

String sectionArrows(
  1. String name,
  2. {bool start = true}
)

Returns a marker with section arrows surrounding the given string.

Specifying start as false returns an ending marker instead of a starting marker.

Implementation

String sectionArrows(String name, {bool start = true}) {
  const int markerArrows = 8;
  final String arrows =
      (start ? '\u25bc' /* ▼ */ : '\u25b2' /* ▲ */) * markerArrows;
  final String marker =
      '//* $arrows $name $arrows (do not modify or remove section marker)';
  return '${start ? '\n//*${'*' * marker.length}\n' : '\n'}'
      '$marker'
      '${!start ? '\n//*${'*' * marker.length}\n' : '\n'}';
}