findInPath method

String? findInPath(
  1. bool condition(
    1. String segment
    )
)

Get the last segment of the path that matches a condition

Implementation

String? findInPath(bool Function(String segment) condition) {
  return path.lastWhere((segment) => condition(segment), orElse: () => '');
}