FileWriter class

Centralizes file writing for the generators: respects --force (overwrite) and --dry-run (report only), and accumulates a summary it can print at the end so every command reports its work the same way.

Constructors

FileWriter({bool force = false, bool dryRun = false})

Properties

dryRun bool
final
force bool
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
wroteNothing bool
no setter

Methods

ensureDir(String path) → void
Creates path's parent directory if needed (no-op in dry-run).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
printSummary() → void
Prints a compact summary of everything written.
toString() String
A string representation of this object.
inherited
write(String path, String content) WriteResult
Writes content to path honoring force/dry-run, records the outcome, prints a per-file line, and returns what happened.

Operators

operator ==(Object other) bool
The equality operator.
inherited