Removed Jiffy

This commit is contained in:
rlee1990
2023-06-06 12:11:25 -04:00
parent 4dcc747f94
commit ba3f61fa15
4 changed files with 6 additions and 7 deletions
@@ -108,7 +108,7 @@ class _ConnectedTitleState extends StatelessWidget {
} else { } else {
alternativeWidget = Text( alternativeWidget = Text(
'${context.translations.userLastOnlineText} ' '${context.translations.userLastOnlineText} '
'${Jiffy(otherMember.user!.lastActive!).fromNow()}', '${Jiffy(otherMember.user?.lastActive).fromNow()}',
style: textStyle, style: textStyle,
); );
} }
@@ -666,12 +666,11 @@ class _StreamMessageListViewState extends State<StreamMessageListView> {
final createdAt = message.createdAt.toLocal(); final createdAt = message.createdAt.toLocal();
final nextCreatedAt = nextMessage.createdAt.toLocal(); final nextCreatedAt = nextMessage.createdAt.toLocal();
if (!Jiffy(createdAt) if (!Jiffy(createdAt).isSame(nextCreatedAt, Units.DAY)) {
.isSame(Jiffy(nextCreatedAt), Units.DAY)) {
separator = _buildDateDivider(nextMessage); separator = _buildDateDivider(nextMessage);
} else { } else {
final hasTimeDiff = !Jiffy(createdAt).isSame( final hasTimeDiff = !Jiffy(createdAt).isSame(
Jiffy(nextCreatedAt), nextCreatedAt,
Units.MINUTE, Units.MINUTE,
); );
@@ -1063,7 +1062,7 @@ class _StreamMessageListViewState extends State<StreamMessageListView> {
var hasTimeDiff = false; var hasTimeDiff = false;
if (nextMessage != null) { if (nextMessage != null) {
hasTimeDiff = !Jiffy(message.createdAt.toLocal()).isSame( hasTimeDiff = !Jiffy(message.createdAt.toLocal()).isSame(
Jiffy(nextMessage.createdAt.toLocal()), nextMessage.createdAt.toLocal(),
Units.MINUTE, Units.MINUTE,
); );
} }
@@ -179,7 +179,7 @@ class UserLastActive extends StatelessWidget {
user.online user.online
? context.translations.userOnlineText ? context.translations.userOnlineText
: '${context.translations.userLastOnlineText} ' : '${context.translations.userLastOnlineText} '
'${Jiffy(user.lastActive!).fromNow()}', '${Jiffy(user.lastActive).fromNow()}',
style: chatTheme.textTheme.footnote.copyWith( style: chatTheme.textTheme.footnote.copyWith(
color: chatTheme.colorTheme.textHighEmphasis.withOpacity(0.5), color: chatTheme.colorTheme.textHighEmphasis.withOpacity(0.5),
), ),
@@ -77,7 +77,7 @@ class StreamUserItem extends StatelessWidget {
user.online user.online
? context.translations.userOnlineText ? context.translations.userOnlineText
: '${context.translations.userLastOnlineText} ' : '${context.translations.userLastOnlineText} '
'${Jiffy(user.lastActive!).fromNow()}', '${Jiffy(user.lastActive).fromNow()}',
style: chatTheme.textTheme.footnote.copyWith( style: chatTheme.textTheme.footnote.copyWith(
color: chatTheme.colorTheme.textHighEmphasis.withOpacity(0.5), color: chatTheme.colorTheme.textHighEmphasis.withOpacity(0.5),
), ),