getFilePath static method

String getFilePath(
  1. String relativePath
)

Get full file path within the POD.

relativePath - Path relative to the app directory. Example: data/places/places.jsongeopod/data/places/places.json Example: datageopod/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';
}