FurryChat/lib/utils/room_extension.dart
2020-01-19 16:56:13 +01:00

15 lines
431 B
Dart

import 'package:famedlysdk/famedlysdk.dart';
import 'package:flutter/material.dart';
extension LocalizedRoomDisplayname on Room {
String getLocalizedDisplayname(BuildContext context) {
if ((this.name?.isEmpty ?? true) &&
(this.canonicalAlias?.isEmpty ?? true) &&
!this.isDirectChat &&
this.mHeroes.isNotEmpty) {
return "Group with ${this.displayname}";
}
return this.displayname;
}
}