FileState class
A model class to manage the state of file operations in the file service.
This class encapsulates all the state variables that were previously scattered throughout the FileService widget, providing a more organized and maintainable way to manage file operation states.
Constructors
- FileState.new({String? uploadFile, String? downloadFile, String? remoteFileName = 'remoteFileName', String? cleanFileName = 'remoteFileName', String? remoteFileUrl, String? filePreview, String? currentPath = basePath, bool uploadInProgress = false, bool downloadInProgress = false, bool deleteInProgress = false, bool importInProgress = false, bool exportInProgress = false, bool uploadDone = false, bool downloadDone = false, bool deleteDone = false, bool showPreview = false})
- Creates a new FileState with default values.
Properties
- cleanFileName ↔ String?
-
The clean name of the file (without encryption extension).
getter/setter pair
- currentPath ↔ String?
-
The current directory path.
getter/setter pair
- deleteDone ↔ bool
-
getter/setter pair
- deleteInProgress ↔ bool
-
getter/setter pair
- downloadDone ↔ bool
-
getter/setter pair
- downloadFile ↔ String?
-
The currently selected file for download.
getter/setter pair
- downloadInProgress ↔ bool
-
getter/setter pair
- exportInProgress ↔ bool
-
getter/setter pair
- filePreview ↔ String?
-
The preview content of the selected file.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- importInProgress ↔ bool
-
getter/setter pair
- isInBpDirectory → bool
-
Checks if the current path is in the blood pressure directory.
no setter
- isInProfileDirectory → bool
-
Checks if the current path is in the profile directory.
no setter
- isInVaccinationDirectory → bool
-
Checks if the current path is in the vaccination directory.
no setter
- remoteFileName ↔ String?
-
The name of the file on the remote server.
getter/setter pair
- remoteFileUrl ↔ String?
-
The URL of the remote file.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showPreview ↔ bool
-
getter/setter pair
- uploadDone ↔ bool
-
getter/setter pair
- uploadFile ↔ String?
-
The currently selected file for upload.
getter/setter pair
- uploadInProgress ↔ bool
-
Operation status flags.
getter/setter pair
Methods
-
copyWith(
{String? uploadFile, String? downloadFile, String? remoteFileName, String? cleanFileName, String? remoteFileUrl, String? filePreview, String? currentPath, bool? uploadInProgress, bool? downloadInProgress, bool? deleteInProgress, bool? importInProgress, bool? exportInProgress, bool? uploadDone, bool? downloadDone, bool? deleteDone, bool? showPreview}) → FileState - Creates a copy of this FileState with the given fields replaced with new values.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited