FileSystemUtils class
These methods use several Flutter libraries and functions such as getTemporaryDirectory(), getApplicationDocumentsDirectory(), File(), Directory(), path.join(), writeAsString(), readAsString(), exists(), and create(). These libraries and functions provide basic file input/output capabilities for Flutter applications.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
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
Static Methods
-
createFolderInAppDocDir(
String folderName) → Future< String> - This method creates a new folder with the given folderName in the application documents directory and returns its path.
-
createOrGetFolderInWalletDir(
String walletDirName, String walletName) → Future< String> - This method asynchronously retrieves the wallet directory path by calling getWalletDir, creates a target folder path by joining the wallet directory path with the provided wallet name, and checks if the folder exists. If it exists, the path is returned. If it doesn't exist, the folder is created and its path is returned.
-
existsDirectory(
String dirName) → Future< bool> - This method asynchronously retrieves the directory path by calling getDirectoryPath, checks whether the directory exists using the exists method of the Directory object, and returns a Future
-
existsFile(
String fileName) → Future< bool> - This method checks if the file with the given fileName exists in the application documents directory and returns a boolean value indicating the result.
-
getDirectoryPath(
String dirName) → Future< String> - This method asynchronously retrieves the application's documents directory path using getApplicationDocumentsDirectory, and then constructs a directory path by concatenating the documents path with the provided dirName. The resulting directory path is returned as a Future-wrapped String.
-
getFilePath(
String fileName) → Future< String> - This method returns the file path with the given fileName in the application documents directory.
-
getSubDirectoryFilePath(
String walletDirName, String walletName, String fileName) → Future< String> - This method asynchronously retrieves the wallet directory path by calling createOrGetFolderInWalletDir, and then constructs a file path by concatenating the wallet path with the provided fileName. The resulting file path is returned as a Future-wrapped String.
-
getTempFilePath(
String tempFileName) → Future< String> - This method returns a temporary file path with the given tempFileName in the temporary directory of the device.
-
getWalletDir(
String walletDirName) → Future< Directory> - This method asynchronously retrieves the application's documents directory and then creates a new Directory object representing a specific wallet directory within that path.
-
getWalletsInWalletsDir(
String walletDirName, String filteredExtension) → Future< List< String> > - This method returns a list of wallet file names in the wallet directory with the given walletDirName and filtered by the given filteredExtension.
-
readFile(
String fileName) → Future< String> - This method reads the content of the file with the given fileName in the application documents directory and returns it as a string.
-
readFileFromPath(
String filePath) → Future< String> - This method reads the content of the file at the given filePath and returns it as a string.
-
saveFile(
String fileName, String content) → Future< bool> - This method saves the given content to the file with the given fileName in the application documents directory.
-
saveFileByte(
String fileName, ByteData data) → Future< bool> - This method saves the given ByteData object to the file with the given fileName in the application documents directory.
-
saveFileFromPath(
String filePath, String content) → Future< bool> - This method saves the given content to the file at the given filePath.
-
saveFileInWalletDir(
String walletDirName, String walletName, String fileName, String content) → Future< bool> - This method saves the given content to the file with the given fileName in the application documents directory.
-
saveQRtoAFile(
String walletName, String input) → Future< bool> - This method static Future
-
writeToFile(
ByteData data, String path) → Future< void> - The method does not return any value explicitly (hence Future