copyWith method
FilePickerModel
copyWith({
- String? currentDirectory,
- List<
String> ? allowedTypes, - bool? fileAllowed,
- bool? dirAllowed,
- bool? showHidden,
- bool? showPermissions,
- bool? showSize,
- int? height,
- bool? autoHeight,
- String? cursor,
- FilePickerKeyMap? keyMap,
- FilePickerStyles? styles,
- List<
FileEntry> ? files, - int? selected,
- int? min,
- int? max,
- String? selectedPath,
- bool clearSelectedPath = false,
- List<
ViewState> ? selectedStack, - int? id,
- String? errorMessage,
- bool clearError = false,
Creates a copy of this model with the given fields replaced.
Implementation
FilePickerModel copyWith({
String? currentDirectory,
List<String>? allowedTypes,
bool? fileAllowed,
bool? dirAllowed,
bool? showHidden,
bool? showPermissions,
bool? showSize,
int? height,
bool? autoHeight,
String? cursor,
FilePickerKeyMap? keyMap,
FilePickerStyles? styles,
List<FileEntry>? files,
int? selected,
int? min,
int? max,
String? selectedPath,
bool clearSelectedPath = false,
List<ViewState>? selectedStack,
int? id,
String? errorMessage,
bool clearError = false,
}) {
return FilePickerModel._(
currentDirectory: currentDirectory ?? _currentDirectory,
allowedTypes: allowedTypes ?? _allowedTypes,
fileAllowed: fileAllowed ?? _fileAllowed,
dirAllowed: dirAllowed ?? _dirAllowed,
showHidden: showHidden ?? _showHidden,
showPermissions: showPermissions ?? _showPermissions,
showSize: showSize ?? _showSize,
height: height ?? _height,
autoHeight: autoHeight ?? _autoHeight,
cursor: cursor ?? _cursor,
keyMap: keyMap ?? _keyMap,
styles: styles ?? _styles,
files: files ?? _files,
selected: selected ?? _selected,
min: min ?? _min,
max: max ?? _max,
selectedPath: clearSelectedPath ? null : (selectedPath ?? _selectedPath),
selectedStack: selectedStack ?? _selectedStack,
id: id ?? _id,
errorMessage: clearError ? null : (errorMessage ?? _errorMessage),
);
}