getParentDir method

String getParentDir(
  1. String path
)

Returns the parent directory of path, computed by stripping the last component from the path.

Example:

getParentDir('/flutter/app/dir/test'); // '/flutter/app/dir'

Implementation

String getParentDir(String path) =>
    (path.split(pathJoin)..removeLast()).join(pathJoin);