src_non_web/io library
Functions
-
clearFile(
String filePath) → Future< void> -
Clears the contents of the file located at
filePath. -
deleteFile(
String filePath) → Future< void> -
Deletes the file located at
filePath. -
fileExists(
String filePath) → Future< bool> -
Returns
trueif the file located atfilePathexists. -
findFileByName(
String fileName, String directoryPath) → Future< File?> -
Finds a file with the given
fileNamein the directory located atdirectoryPath. Returnsnullif the directory does not exist or if the -
getDesktopPath(
) → String - Gets the current Operating System's Desktop path.
-
listFilePaths(
String dirPath, {bool recursive = true}) → Future< List< String> ?> -
Lists the file paths of the files in the directory located at
dirPath. Setrecursivetotrueto list the file paths of the files in the sub-directories as well. -
readFile(
String filePath) → Future< String?> -
Reads the contents of the file located at
filePathas a String. -
readFileAsLines(
String filePath) → Future< List< String> ?> -
Reads the contents of the file located at
filePathas a list of lines. -
writeFile(
String filePath, String content, {bool append = false}) → Future< void> -
Writes the given
contentto the file located atfilePath. Setappendtotrueto append thecontentto the file instead of overwriting it.