normalizePath method
Normalizes a file path to an absolute path with correct separators.
Handles converting relative paths to absolute paths and normalizes the path format according to the current platform.
path
The path to normalize.
Returns the normalized absolute path.
Implementation
String normalizePath(String path) {
final normalized = p.normalize(path);
return p.isAbsolute(normalized) ? normalized : p.absolute(normalized);
}