import 'package:path/path.dart' as p; p.join('directory', 'file.txt'); var context = p.Context(style: Style.windows); context.join('directory', 'file.txt');