Gets basename from path.
String basename(String path) { final parts = path.split('/'); return parts.isEmpty ? path : parts.last; }