String name(String? resourcePath) { if (resourcePath?.isEmpty ?? true) { return ''; } final pathSegments = resourcePath!.split('/'); return pathSegments.last.trim(); }