FileHelper class
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
-
copy(String filePath, String newPath)
→ Future<void>
-
Copies a file from source path to a new path
-
create(String path, {bool createFoldersInPath = true})
→ Future<File>
-
Creates a file at the specified path (The file's name is the last is that path).
-
delete(String path, {bool recursive = false})
→ Future<void>
-
-
exists(String path)
→ Future<bool>
-
Checks if the file exists.
-
find(String rootPath, String name, {bool isExactMatch = false, bool ignoreHidden = true})
→ Future<List<String>>
-
Search for a file bu it's name.
-
findAdvanced(String rootPath, RegExp pattern, {bool ignoreHidden = true})
→ Future<List<String>>
-
Search for a file with a RegExp pattern.
-
listAll(String rootPath, {bool includeHidden = false, List<RegExp>? excluded, List<RegExp>? allowed})
→ Future<List<File>>
-
List all the files in this root directory.
-
move(String oldPath, String newPath)
→ Future<void>
-
Moves a file to a new path
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a nonexistent method or property is accessed.
inherited
-
readAsBytes(String path)
→ Future<Uint8List>
-
Read the content of a file as bytes (Uint8List)
-
readAsString(String path)
→ Future<String>
-
Read the content of a file as String
-
rename(String path, String newName)
→ Future<void>
-
Rename the file
-
search(String rootPath, RegExp pattern, {bool ignoreHidden = true, List<RegExp> excluded = const [], List<RegExp> allowed = const []})
→ Future<Map<String, List<(int, String, Map<int, String>)>>>
-
Search through all the files for a RegExp pattern.
-
searchAndReplace(String rootPath, RegExp pattern, {bool ignoreHidden = true, List<RegExp> excluded = const [], List<RegExp> allowed = const [], String? replacement})
→ Future<Map<String, List<(int, String, Map<int, String>)>>>
-
Search the content of files in a root path for a RegExp pattern and replace it.
-
toString()
→ String
-
A string representation of this object.
inherited
-
writeBytes(String path, Uint8List content, {bool rewrite = true})
→ Future<void>
-
Write content to a file as bytes (Uint8List). File will be created if it doesn't exist.
-
writeString(String path, String content, {bool rewrite = true})
→ Future<void>
-
Write content to a file as String. File will be created if it doesn't exist.