Get the last segment of the path that matches a condition
String? findInPath(bool Function(String segment) condition) { return path.lastWhere((segment) => condition(segment), orElse: () => ''); }