clear method Null safety

Future<void> clear()

Implementation

Future<void> clear() async {
  var futures = <Future<void>>[];
  for (var fp in files) {
    futures.add(fp.close());
  }
  files.clear();
  _fileMap.clear();
  comment = null;
  await Future.wait(futures);
}