FileSync constructor

FileSync(
  1. [BaseLogger? logger]
)

The public constructor. If logger is null an isolated instance is returned. Otherwise a singleton. Note: normally the singleton instance should be used. Only in special cases like different threads ("isolates") isolated instances will be meaningful.

Implementation

factory FileSync([BaseLogger? logger]) {
  final rc = logger != null
      ? FileSync._internal(logger)
      : _instance ??= FileSync._internal(globalLogger);
  if (logger != null) {
    rc._logger = logger;
  }
  return rc;
}