mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-24 04:59:26 +01:00
Merge branch 'soru/fix-avatar' into 'main'
fix: Some single-emoji names crashing See merge request ChristianPauly/fluffychat-flutter!231
This commit is contained in:
commit
d0635d9dd4
@ -30,9 +30,9 @@ class Avatar extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
final src = thumbnail;
|
final src = thumbnail;
|
||||||
var fallbackLetters = '@';
|
var fallbackLetters = '@';
|
||||||
if ((name?.length ?? 0) >= 2) {
|
if ((name?.runes?.length ?? 0) >= 2) {
|
||||||
fallbackLetters = String.fromCharCodes(name.runes, 0, 2);
|
fallbackLetters = String.fromCharCodes(name.runes, 0, 2);
|
||||||
} else if ((name?.length ?? 0) == 1) {
|
} else if ((name?.runes?.length ?? 0) == 1) {
|
||||||
fallbackLetters = name;
|
fallbackLetters = name;
|
||||||
}
|
}
|
||||||
final textWidget = Center(
|
final textWidget = Center(
|
||||||
|
Loading…
Reference in New Issue
Block a user