fluffychat/lib/utils/presence_extension.dart

14 lines
421 B
Dart
Raw Normal View History

import 'package:famedlysdk/famedlysdk.dart';
2020-05-07 07:52:40 +02:00
import 'package:fluffychat/l10n/l10n.dart';
import 'package:flutter/material.dart';
2020-05-06 18:31:38 +02:00
import 'date_time_extension.dart';
extension PresenceExtension on Presence {
String getLocalizedStatusMessage(BuildContext context) {
if (statusMsg?.isNotEmpty ?? false) {
return statusMsg;
}
2020-05-07 07:52:40 +02:00
return L10n.of(context).lastActiveAgo(time.localizedTimeShort(context));
}
}