getFilePath static method
- String relativePath
Get full file path within the POD.
relativePath - Path relative to the app directory.
Example: data/places/places.json → geopod/data/places/places.json
Example: data → geopod/data
Example: `` (empty) → geopod
Implementation
static String getFilePath(String relativePath) {
// Remove leading slash if present.
final cleanPath = relativePath.startsWith('/')
? relativePath.substring(1)
: relativePath;
// If path already includes app dir, return as-is
if (cleanPath.startsWith('$appDirName/') || cleanPath == appDirName) {
return cleanPath;
}
// Empty path means app root.
if (cleanPath.isEmpty) {
return appDirName;
}
// Otherwise prepend app dir.
return '$appDirName/$cleanPath';
}