write method

  1. @override
void write(
  1. StringBuffer buffer,
  2. InitConfig config
)
override

Writes this section's content to buffer using the provided config.

Implementation

@override
void write(
  StringBuffer buffer,
  InitConfig config,
) {
  final environment = config.environment;

  buffer.writeln('environment:');
  buffer.writeln('  enabled: ${environment.enabled}');

  if (environment.configurations.isEmpty) {
    buffer.writeln('  configurations: {}');
    return;
  }

  buffer.writeln();
  buffer.writeln('  configurations:');

  for (final entry in environment.configurations.entries) {
    buffer.writeln('    ${entry.key}:');
    buffer.writeln('      file: ${entry.value.file}');
  }
}