FsUtils class
Utility class for file system operations.
Provides helper methods for common file system tasks including project detection, file I/O, and string case conversion.
Constructors
- FsUtils()
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) → void -
Appends
contentto the file atpath. -
createDir(
String path) → void -
Creates a directory at
path, including parent directories. -
dirExists(
String path) → bool -
Returns true if a directory exists at
path. -
fileExists(
String path) → bool -
Returns true if a file exists at
path. -
isFlutterProjectRoot(
String dir) → bool - Checks if the given directory is a Flutter project root.
-
readFile(
String path) → String -
Reads and returns the content of the file at
path. -
replaceInFile(
String path, String from, String to) → void -
Replaces all occurrences of
fromwithtoin the file atpath. -
toPascalCase(
String input) → String - Converts snake_case to PascalCase.
-
toSnakeCase(
String input) → String - Converts PascalCase or camelCase to snake_case.
-
toSnakeCaseSafe(
String input) → String - Safely converts any input to snake_case.
-
writeFile(
String path, String content) → void -
Writes
contentto the file atpath, creating parent directories if needed.