FileUtils class

Utilities for safe file reading and writing in Vaden projects

Constructors

FileUtils()

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

appendToFile(String path, String content) → Future<void>
Append content to file
createFileIfNotExists(String path, String content) → Future<bool>
Create file with content if it doesn't exist
directoryExists(String path) → Future<bool>
Check if directory exists
ensureDirectory(String path) → Future<void>
Ensure directory exists
fileExists(String path) → Future<bool>
Check if file exists
findFiles(String directory, String pattern) → Future<List<String>>
Find files matching pattern recursively
getRelativePath(String projectRoot, String filePath) → String
Get relative path from project root
insertAtLine(String path, int lineNumber, String content) → Future<void>
Insert content at specific line
listFiles(String directory, {String? pattern, bool recursive = false}) → Future<List<String>>
List files in directory with optional pattern
readFile(String path) → Future<String>
Read file content safely
readLines(String path) → Future<List<String>>
Read file as lines
replaceLine(String path, int lineNumber, String newContent) → Future<void>
Replace line at specific index
writeFile(String path, String content) → Future<void>
Write content to file safely