Fix code formatting

This commit is contained in:
Nutcake 2023-11-11 12:00:01 +01:00
parent 4e7181a20f
commit 5cd8f56895
2 changed files with 6 additions and 13 deletions

View file

@ -12,8 +12,7 @@ import 'package:recon/widgets/generic_avatar.dart';
import 'package:recon/widgets/messages/messages_list.dart'; import 'package:recon/widgets/messages/messages_list.dart';
class FriendListTile extends StatelessWidget { class FriendListTile extends StatelessWidget {
const FriendListTile( const FriendListTile({required this.friend, required this.unreads, this.onTap, super.key});
{required this.friend, required this.unreads, this.onTap, super.key});
final Friend friend; final Friend friend;
final int unreads; final int unreads;
@ -26,8 +25,7 @@ class FriendListTile extends StatelessWidget {
final mClient = Provider.of<MessagingClient>(context, listen: false); final mClient = Provider.of<MessagingClient>(context, listen: false);
final currentSession = friend.userStatus.currentSessionIndex == -1 final currentSession = friend.userStatus.currentSessionIndex == -1
? null ? null
: friend.userStatus.decodedSessions : friend.userStatus.decodedSessions.elementAtOrNull(friend.userStatus.currentSessionIndex);
.elementAtOrNull(friend.userStatus.currentSessionIndex);
return ListTile( return ListTile(
leading: GenericAvatar( leading: GenericAvatar(
imageUri: imageUri, imageUri: imageUri,
@ -35,8 +33,7 @@ class FriendListTile extends StatelessWidget {
trailing: unreads != 0 trailing: unreads != 0
? Text( ? Text(
"+$unreads", "+$unreads",
style: theme.textTheme.bodyMedium style: theme.textTheme.bodyMedium?.copyWith(color: theme.colorScheme.primary),
?.copyWith(color: theme.colorScheme.primary),
) )
: null, : null,
title: Row( title: Row(
@ -61,8 +58,7 @@ class FriendListTile extends StatelessWidget {
const SizedBox( const SizedBox(
width: 4, width: 4,
), ),
Text(toBeginningOfSentenceCase(friend.userStatus.onlineStatus.name) ?? Text(toBeginningOfSentenceCase(friend.userStatus.onlineStatus.name) ?? "Unknown"),
"Unknown"),
if (!(friend.userStatus.onlineStatus == OnlineStatus.offline || if (!(friend.userStatus.onlineStatus == OnlineStatus.offline ||
friend.userStatus.onlineStatus == OnlineStatus.invisible)) friend.userStatus.onlineStatus == OnlineStatus.invisible))
if (currentSession != null) ...[ if (currentSession != null) ...[

View file

@ -9,8 +9,7 @@ class FriendOnlineStatusIndicator extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return userStatus.appVersion.contains("ReCon") && return userStatus.appVersion.contains("ReCon") && userStatus.onlineStatus != OnlineStatus.offline
userStatus.onlineStatus != OnlineStatus.offline
? SizedBox.square( ? SizedBox.square(
dimension: 10, dimension: 10,
child: Image.asset( child: Image.asset(
@ -21,9 +20,7 @@ class FriendOnlineStatusIndicator extends StatelessWidget {
), ),
) )
: Icon( : Icon(
userStatus.onlineStatus == OnlineStatus.offline userStatus.onlineStatus == OnlineStatus.offline ? Icons.circle_outlined : Icons.circle,
? Icons.circle_outlined
: Icons.circle,
color: userStatus.onlineStatus.color(context), color: userStatus.onlineStatus.color(context),
size: 10, size: 10,
); );