SnippetSample.surround constructor

SnippetSample.surround(
  1. String prefix,
  2. List<SourceLine> code,
  3. String postfix, {
  4. required int index,
})

Implementation

factory SnippetSample.surround(
  String prefix,
  List<SourceLine> code,
  String postfix, {
  required int index,
}) {
  return SnippetSample(
    <SourceLine>[
      if (prefix.isNotEmpty) SourceLine(prefix),
      ...code,
      if (postfix.isNotEmpty) SourceLine(postfix),
    ],
    index: index,
    lineProto: code.first,
  );
}