FileList constructor

FileList(
  1. Directory directory,
  2. String pattern, {
  3. bool? caseSensitive,
  4. void notify(
    1. String path
    )?,
})

Creates file list.

Parameters: directory Directory whic will be listed. pattern Glob pattern of this file list. caseSensitive True, if the pattern is case sensitive; otherwise false. notify Function that is called whenever an item is added.

Implementation

FileList(this.directory, String pattern,
    {bool? caseSensitive, void Function(String path)? notify}) {
  if (caseSensitive == null) {
    if (_isWindows) {
      caseSensitive = false;
    } else {
      caseSensitive = true;
    }
  }

  _caseSensitive = caseSensitive;
  _notify = notify;
  _pattern = FilePath.expand(pattern);
  _files = _getFiles();
}