feat-insert-service (#5)

Reviewed-on: http://catelliub.zapto.org:3000/brontomark/flux/pulls/5
Co-authored-by: mark-cachy <marco@catelli.it>
Co-committed-by: mark-cachy <marco@catelli.it>
This commit is contained in:
2026-04-20 16:52:20 +02:00
committed by brontomark
parent 667bbf6404
commit c3d4f3fac7
63 changed files with 4715 additions and 1371 deletions

View File

@@ -19,4 +19,24 @@ extension MyStringExtensions on String? {
})
.join(' ');
}
String fileExtension() {
if (this == null || this!.trim().isEmpty) return '';
final parts = this!.split('.');
if (parts.length < 2) return ''; // Nessuna estensione trovata
return parts.last.toLowerCase();
}
String fileNameWithoutExtension() {
if (this == null || this!.trim().isEmpty) return '';
this!.replaceAll(RegExp(r'[^a-zA-Z0-9\.\-]'), '_');
final parts = this!.split('.');
if (parts.length < 2) return this!; // Nessuna estensione trovata
return parts
.sublist(0, parts.length - 1)
.join('.'); // Ritorna tutto tranne l'ultima parte
}
}