build method Null safety

String build(
  1. {bool nullSafety = true}
)

Implementation

String build({bool nullSafety = true}) {
  final result = StringBuffer();
  if (defaultValue == null && isRequired) {
    result.write(' ${nullSafety ? '' : '@'}required ');
  }
  result.write('$type $name');
  if (defaultValue != null) {
    result.write('= $defaultValue');
  }
  return result.toString();
}