Frontend first draft

This commit is contained in:
Arseni
2025-11-13 15:06:15 +03:00
parent e47f343afb
commit ddb54ddfdc
504 changed files with 25498 additions and 1 deletions

View File

@@ -0,0 +1,17 @@
class NameInitials {
static const unknown = '?';
}
String getNameInitials(String name) {
if (name.isEmpty) return NameInitials.unknown;
// Split the name by whitespace.
final words = name.trim().split(RegExp(r'\s+'));
if (words.isEmpty) return NameInitials.unknown;
// If there's only one word, return its first letter.
if (words.length == 1) return words.first[0].toUpperCase();
// Otherwise, use the first letter of the first and last words.
return (words.first[0] + words.last[0]).toUpperCase();
}