withExtension method
Creates an Path like this but with the given extension.
Implementation
Path withExtension(String extension) => isWindows
? Path(WindowsPath(_string).withExtension(extension)._string)
: Path(UnixPath(_string).withExtension(extension)._string);