isWithin function

bool isWithin(
  1. String parent,
  2. String child
)

Returns true if child is a path beneath parent, and false otherwise.

p.isWithin('/root/path', '/root/path/a'); // -> true
p.isWithin('/root/path', '/root/other'); // -> false
p.isWithin('/root/path', '/root/path') // -> false

Implementation

bool isWithin(String parent, String child) => context.isWithin(parent, child);