Merge pull request #16 from Nutcake/isovel/contact-status-parity
feat: match contact status formatting w/ Resonite
This commit is contained in:
commit
585c5fae58
2 changed files with 27 additions and 16 deletions
|
@ -5,6 +5,7 @@ import 'package:recon/auxiliary.dart';
|
|||
import 'package:recon/clients/messaging_client.dart';
|
||||
import 'package:recon/models/message.dart';
|
||||
import 'package:recon/models/users/friend.dart';
|
||||
import 'package:recon/models/users/online_status.dart';
|
||||
import 'package:recon/widgets/formatted_text.dart';
|
||||
import 'package:recon/widgets/friends/friend_online_status_indicator.dart';
|
||||
import 'package:recon/widgets/generic_avatar.dart';
|
||||
|
@ -58,25 +59,34 @@ class FriendListTile extends StatelessWidget {
|
|||
width: 4,
|
||||
),
|
||||
Text(toBeginningOfSentenceCase(friend.userStatus.onlineStatus.name) ?? "Unknown"),
|
||||
if (currentSession != null && currentSession.isVisible) ...[
|
||||
const Text(" in "),
|
||||
if (currentSession.name.isNotEmpty)
|
||||
Expanded(
|
||||
child: FormattedText(
|
||||
currentSession.formattedName,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 1,
|
||||
),
|
||||
)
|
||||
else
|
||||
if (!(friend.userStatus.onlineStatus == OnlineStatus.offline ||
|
||||
friend.userStatus.onlineStatus == OnlineStatus.invisible))
|
||||
if (currentSession != null) ...[
|
||||
const Text(" in "),
|
||||
if (currentSession.name.isNotEmpty)
|
||||
Expanded(
|
||||
child: FormattedText(
|
||||
currentSession.formattedName,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 1,
|
||||
),
|
||||
)
|
||||
else
|
||||
Expanded(
|
||||
child: Text(
|
||||
"${currentSession.accessLevel.toReadableString()} World",
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 1,
|
||||
),
|
||||
)
|
||||
] else if (friend.userStatus.appVersion.isNotEmpty)
|
||||
Expanded(
|
||||
child: Text(
|
||||
"${currentSession.accessLevel.toReadableString()} session",
|
||||
" on version ${friend.userStatus.appVersion}",
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 1,
|
||||
),
|
||||
)
|
||||
]
|
||||
),
|
||||
],
|
||||
),
|
||||
onTap: () async {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:recon/models/users/online_status.dart';
|
||||
import 'package:recon/models/users/user_status.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class FriendOnlineStatusIndicator extends StatelessWidget {
|
||||
const FriendOnlineStatusIndicator({required this.userStatus, super.key});
|
||||
|
@ -14,8 +14,9 @@ class FriendOnlineStatusIndicator extends StatelessWidget {
|
|||
dimension: 10,
|
||||
child: Image.asset(
|
||||
"assets/images/logo-white.png",
|
||||
alignment: Alignment.center,
|
||||
color: userStatus.onlineStatus.color(context),
|
||||
filterQuality: FilterQuality.medium,
|
||||
isAntiAlias: true,
|
||||
),
|
||||
)
|
||||
: Icon(
|
||||
|
|
Loading…
Reference in a new issue