copyTo method

Future<void> copyTo(
  1. File other
)

Copies content of this to other file.

Implementation

Future<void> copyTo(File other) async {
  final sink = other.openWrite();
  await sink.addStream(openRead());
  await sink.close();
}