Design improvements
This commit is contained in:
parent
e5aa94bb62
commit
ec9e8fe5d4
10 changed files with 278 additions and 159 deletions
23
lib/utils/room_status_extension.dart
Normal file
23
lib/utils/room_status_extension.dart
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import 'package:famedlysdk/famedlysdk.dart';
|
||||
import 'package:fluffychat/l10n/l10n.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
import 'date_time_extension.dart';
|
||||
|
||||
extension RoomStatusExtension on Room {
|
||||
Presence get directChatPresence => client.presences[directChatMatrixID];
|
||||
|
||||
String getLocalizedStatus(BuildContext context) {
|
||||
if (isDirectChat) {
|
||||
if (directChatPresence != null) {
|
||||
if (directChatPresence.currentlyActive == true) {
|
||||
return L10n.of(context).currentlyActive;
|
||||
}
|
||||
return L10n.of(context)
|
||||
.lastActiveAgo(directChatPresence.time.localizedTimeShort(context));
|
||||
}
|
||||
return L10n.of(context).lastSeenLongTimeAgo;
|
||||
}
|
||||
return L10n.of(context).countParticipants(mJoinedMemberCount.toString());
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue