build method

  1. @override
String build()
override

Implementation

@override
String build() {
  if (isAbstract) {
    return OneLine(depth: depth, body: '${functionSignature()};').build();
  }
  var fullSignature = functionSignature();
  if (isAsync) {
    fullSignature += ' ';
    fullSignature += 'async';
    fullSignature += ' ';
  }
  return CodeUnit.join([
    OneLine(depth: depth, body: '$fullSignature {'),
    if (body != null) ...body!(depth),
    OneLine(depth: depth, body: '}')
  ]);
}