# writeLine method

Future<void> writeLine([

1. String? str

])

Writes a string followed by a line separator.

This is a convenience method that combines write and newLine.

## Parameters

- `str`: String to write (if null, writes "null")

## Example

    final writer = FileWriter('output.txt');
    try {
      await writer.writeLine('First line');
      await writer.writeLine('Second line');
      await writer.writeLine('Third line');
      await writer.flush();
    } finally {
      await writer.close();
    }

Throws IOException if an I/O error occurs. Throws StreamClosedException if the writer has been closed.

## Implementation

    Future<void> writeLine([String? str]) async {
      if (str != null) {
        await write(str);
      }
      await newLine();
    }