2020-01-19 14:07:42 +00:00
|
|
|
import 'package:famedlysdk/famedlysdk.dart';
|
2020-01-20 12:46:39 +00:00
|
|
|
import 'package:fluffychat/i18n/i18n.dart';
|
2020-01-19 14:07:42 +00:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
extension LocalizedRoomDisplayname on Room {
|
|
|
|
String getLocalizedDisplayname(BuildContext context) {
|
|
|
|
if ((this.name?.isEmpty ?? true) &&
|
|
|
|
(this.canonicalAlias?.isEmpty ?? true) &&
|
2020-01-19 15:56:13 +00:00
|
|
|
!this.isDirectChat &&
|
2020-01-23 11:11:57 +00:00
|
|
|
(this.mHeroes != null && this.mHeroes.isNotEmpty)) {
|
2020-01-20 12:46:39 +00:00
|
|
|
return I18n.of(context).groupWith(this.displayname);
|
2020-01-19 14:07:42 +00:00
|
|
|
}
|
|
|
|
return this.displayname;
|
|
|
|
}
|
|
|
|
}
|