dart-use-path-package

Installation
SKILL.md

Safe Cross-Platform Path Manipulation in Dart

Contents


1. Core Principles & Cross-Platform Rules

Avoid Treating File Paths as Raw Strings

  • Native file paths on Windows use backslashes (\), whereas macOS and Linux use forward slashes (/).
  • String operations like .contains('foo/'), .startsWith('foo/'), or .split('/') silently fail on Windows native paths.
  • String interpolation like '$dir/$file' injects forward slashes on Windows and produces duplicate slashes (//) when $dir ends with a trailing slash.
Installs
512
GitHub Stars
485
First Seen
7 days ago
dart-use-path-package — dart-lang/skills