FilePickerModel constructor

FilePickerModel({
  1. required String currentDirectory,
  2. List<String>? allowedTypes,
  3. bool fileAllowed = true,
  4. bool dirAllowed = false,
  5. bool showHidden = false,
  6. bool showPermissions = true,
  7. bool showSize = true,
  8. int height = 10,
  9. bool autoHeight = true,
  10. String cursor = '> ',
  11. FilePickerKeyMap? keyMap,
  12. FilePickerStyles? styles,
})

Creates a new file picker model.

currentDirectory is the starting directory. allowedTypes is a list of allowed file extensions (e.g., '.dart', '.txt'). fileAllowed whether files can be selected. dirAllowed whether directories can be selected. showHidden whether to show hidden files. showPermissions whether to show file permissions. showSize whether to show file sizes. height is the visible height of the file list.

Implementation

FilePickerModel({
  required String currentDirectory,
  List<String>? allowedTypes,
  bool fileAllowed = true,
  bool dirAllowed = false,
  bool showHidden = false,
  bool showPermissions = true,
  bool showSize = true,
  int height = 10,
  bool autoHeight = true,
  String cursor = '> ',
  FilePickerKeyMap? keyMap,
  FilePickerStyles? styles,
}) : _currentDirectory = currentDirectory,
     _allowedTypes = allowedTypes ?? [],
     _fileAllowed = fileAllowed,
     _dirAllowed = dirAllowed,
     _showHidden = showHidden,
     _showPermissions = showPermissions,
     _showSize = showSize,
     _height = height,
     _autoHeight = autoHeight,
     _cursor = cursor,
     _keyMap = keyMap ?? FilePickerKeyMap(),
     _styles = styles ?? FilePickerStyles(),
     _files = [],
     _selected = 0,
     _min = 0,
     _max = height - 1,
     _selectedPath = null,
     _selectedStack = [],
     _id = _nextFilePickerId(),
     _errorMessage = null;