chore(ui): bump jiffy to v6.2.1
Signed-off-by: xsahil03x <xdsahil@gmail.com>
This commit is contained in:
@@ -8,6 +8,7 @@ coverage
|
|||||||
.pub/
|
.pub/
|
||||||
.dart_tool/
|
.dart_tool/
|
||||||
pubspec.lock
|
pubspec.lock
|
||||||
|
pubspec_overrides.yaml
|
||||||
flutter_export_environment.sh
|
flutter_export_environment.sh
|
||||||
|
|
||||||
examples/all_plugins/pubspec.yaml
|
examples/all_plugins/pubspec.yaml
|
||||||
|
|||||||
@@ -106,9 +106,10 @@ class _ConnectedTitleState extends StatelessWidget {
|
|||||||
style: textStyle,
|
style: textStyle,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
final lastActive = otherMember.user?.lastActive ?? DateTime.now();
|
||||||
alternativeWidget = Text(
|
alternativeWidget = Text(
|
||||||
'${context.translations.userLastOnlineText} '
|
'${context.translations.userLastOnlineText} '
|
||||||
'${Jiffy(otherMember.user?.lastActive).fromNow()}',
|
'${Jiffy.parseFromDateTime(lastActive).fromNow()}',
|
||||||
style: textStyle,
|
style: textStyle,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -349,16 +349,16 @@ class _Date extends StatelessWidget {
|
|||||||
|
|
||||||
if (lastMessageAt.millisecondsSinceEpoch >=
|
if (lastMessageAt.millisecondsSinceEpoch >=
|
||||||
startOfDay.millisecondsSinceEpoch) {
|
startOfDay.millisecondsSinceEpoch) {
|
||||||
stringDate = Jiffy(lastMessageAt.toLocal()).jm;
|
stringDate = Jiffy.parseFromDateTime(lastMessageAt.toLocal()).jm;
|
||||||
} else if (lastMessageAt.millisecondsSinceEpoch >=
|
} else if (lastMessageAt.millisecondsSinceEpoch >=
|
||||||
startOfDay
|
startOfDay
|
||||||
.subtract(const Duration(days: 1))
|
.subtract(const Duration(days: 1))
|
||||||
.millisecondsSinceEpoch) {
|
.millisecondsSinceEpoch) {
|
||||||
stringDate = context.translations.yesterdayLabel;
|
stringDate = context.translations.yesterdayLabel;
|
||||||
} else if (startOfDay.difference(lastMessageAt).inDays < 7) {
|
} else if (startOfDay.difference(lastMessageAt).inDays < 7) {
|
||||||
stringDate = Jiffy(lastMessageAt.toLocal()).EEEE;
|
stringDate = Jiffy.parseFromDateTime(lastMessageAt.toLocal()).EEEE;
|
||||||
} else {
|
} else {
|
||||||
stringDate = Jiffy(lastMessageAt.toLocal()).yMd;
|
stringDate = Jiffy.parseFromDateTime(lastMessageAt.toLocal()).yMd;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Text(
|
return Text(
|
||||||
|
|||||||
@@ -611,13 +611,15 @@ class DefaultTranslations implements Translations {
|
|||||||
} else if (date == yesterday) {
|
} else if (date == yesterday) {
|
||||||
return 'yesterday';
|
return 'yesterday';
|
||||||
} else {
|
} else {
|
||||||
return 'on ${Jiffy(date).MMMd}';
|
return 'on ${Jiffy.parseFromDateTime(date).MMMd}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String sentAtText({required DateTime date, required DateTime time}) =>
|
String sentAtText({required DateTime date, required DateTime time}) {
|
||||||
'Sent ${_getDay(date)} at ${Jiffy(time.toLocal()).format('HH:mm')}';
|
final atTime = Jiffy.parseFromDateTime(time.toLocal());
|
||||||
|
return 'Sent ${_getDay(date)} at ${atTime.format(pattern: 'HH:mm')}';
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get todayLabel => 'Today';
|
String get todayLabel => 'Today';
|
||||||
|
|||||||
@@ -669,14 +669,20 @@ class _StreamMessageListViewState extends State<StreamMessageListView> {
|
|||||||
final isPartOfThread = message.replyCount! > 0 ||
|
final isPartOfThread = message.replyCount! > 0 ||
|
||||||
message.showInChannel == true;
|
message.showInChannel == true;
|
||||||
|
|
||||||
final createdAt = message.createdAt.toLocal();
|
final createdAt = Jiffy.parseFromDateTime(
|
||||||
final nextCreatedAt = nextMessage.createdAt.toLocal();
|
message.createdAt.toLocal(),
|
||||||
if (!Jiffy(createdAt).isSame(nextCreatedAt, Units.DAY)) {
|
);
|
||||||
|
|
||||||
|
final nextCreatedAt = Jiffy.parseFromDateTime(
|
||||||
|
nextMessage.createdAt.toLocal(),
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!createdAt.isSame(nextCreatedAt, unit: Unit.day)) {
|
||||||
separator = _buildDateDivider(nextMessage);
|
separator = _buildDateDivider(nextMessage);
|
||||||
} else {
|
} else {
|
||||||
final hasTimeDiff = !Jiffy(createdAt).isSame(
|
final hasTimeDiff = !createdAt.isSame(
|
||||||
nextCreatedAt,
|
nextCreatedAt,
|
||||||
Units.MINUTE,
|
unit: Unit.minute,
|
||||||
);
|
);
|
||||||
|
|
||||||
final isNextUserSame =
|
final isNextUserSame =
|
||||||
@@ -1071,10 +1077,12 @@ class _StreamMessageListViewState extends State<StreamMessageListView> {
|
|||||||
|
|
||||||
var hasTimeDiff = false;
|
var hasTimeDiff = false;
|
||||||
if (nextMessage != null) {
|
if (nextMessage != null) {
|
||||||
hasTimeDiff = !Jiffy(message.createdAt.toLocal()).isSame(
|
final createdAt = Jiffy.parseFromDateTime(message.createdAt.toLocal());
|
||||||
|
final nextCreatedAt = Jiffy.parseFromDateTime(
|
||||||
nextMessage.createdAt.toLocal(),
|
nextMessage.createdAt.toLocal(),
|
||||||
Units.MINUTE,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
hasTimeDiff = !createdAt.isSame(nextCreatedAt, unit: Unit.minute);
|
||||||
}
|
}
|
||||||
|
|
||||||
final hasFileAttachment =
|
final hasFileAttachment =
|
||||||
|
|||||||
@@ -191,7 +191,7 @@ class BottomRow extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
if (showTimeStamp)
|
if (showTimeStamp)
|
||||||
Text(
|
Text(
|
||||||
Jiffy(message.createdAt.toLocal()).jm,
|
Jiffy.parseFromDateTime(message.createdAt.toLocal()).jm,
|
||||||
style: messageTheme.createdAtStyle,
|
style: messageTheme.createdAtStyle,
|
||||||
),
|
),
|
||||||
if (showSendingIndicator)
|
if (showSendingIndicator)
|
||||||
|
|||||||
@@ -20,17 +20,17 @@ class StreamDateDivider extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final createdAt = Jiffy(dateTime);
|
final createdAt = Jiffy.parseFromDateTime(dateTime);
|
||||||
final now = Jiffy(DateTime.now());
|
final now = Jiffy.parseFromDateTime(DateTime.now());
|
||||||
|
|
||||||
var dayInfo = createdAt.MMMd;
|
var dayInfo = createdAt.MMMd;
|
||||||
if (createdAt.isSame(now, Units.DAY)) {
|
if (createdAt.isSame(now, unit: Unit.day)) {
|
||||||
dayInfo = context.translations.todayLabel;
|
dayInfo = context.translations.todayLabel;
|
||||||
} else if (createdAt.isSame(now.subtract(days: 1), Units.DAY)) {
|
} else if (createdAt.isSame(now.subtract(days: 1), unit: Unit.day)) {
|
||||||
dayInfo = context.translations.yesterdayLabel;
|
dayInfo = context.translations.yesterdayLabel;
|
||||||
} else if (createdAt.isAfter(now.subtract(days: 7), Units.DAY)) {
|
} else if (createdAt.isAfter(now.subtract(days: 7), unit: Unit.day)) {
|
||||||
dayInfo = createdAt.EEEE;
|
dayInfo = createdAt.EEEE;
|
||||||
} else if (createdAt.isAfter(now.subtract(years: 1), Units.DAY)) {
|
} else if (createdAt.isAfter(now.subtract(years: 1), unit: Unit.day)) {
|
||||||
dayInfo = createdAt.MMMd;
|
dayInfo = createdAt.MMMd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -287,16 +287,16 @@ class ChannelLastMessageDate extends StatelessWidget {
|
|||||||
|
|
||||||
if (lastMessageAt.millisecondsSinceEpoch >=
|
if (lastMessageAt.millisecondsSinceEpoch >=
|
||||||
startOfDay.millisecondsSinceEpoch) {
|
startOfDay.millisecondsSinceEpoch) {
|
||||||
stringDate = Jiffy(lastMessageAt.toLocal()).jm;
|
stringDate = Jiffy.parseFromDateTime(lastMessageAt.toLocal()).jm;
|
||||||
} else if (lastMessageAt.millisecondsSinceEpoch >=
|
} else if (lastMessageAt.millisecondsSinceEpoch >=
|
||||||
startOfDay
|
startOfDay
|
||||||
.subtract(const Duration(days: 1))
|
.subtract(const Duration(days: 1))
|
||||||
.millisecondsSinceEpoch) {
|
.millisecondsSinceEpoch) {
|
||||||
stringDate = context.translations.yesterdayLabel;
|
stringDate = context.translations.yesterdayLabel;
|
||||||
} else if (startOfDay.difference(lastMessageAt).inDays < 7) {
|
} else if (startOfDay.difference(lastMessageAt).inDays < 7) {
|
||||||
stringDate = Jiffy(lastMessageAt.toLocal()).EEEE;
|
stringDate = Jiffy.parseFromDateTime(lastMessageAt.toLocal()).EEEE;
|
||||||
} else {
|
} else {
|
||||||
stringDate = Jiffy(lastMessageAt.toLocal()).yMd;
|
stringDate = Jiffy.parseFromDateTime(lastMessageAt.toLocal()).yMd;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Text(
|
return Text(
|
||||||
|
|||||||
+2
-2
@@ -227,9 +227,9 @@ class MessageSearchTileMessageDate extends StatelessWidget {
|
|||||||
if (now.year != createdAt.year ||
|
if (now.year != createdAt.year ||
|
||||||
now.month != createdAt.month ||
|
now.month != createdAt.month ||
|
||||||
now.day != createdAt.day) {
|
now.day != createdAt.day) {
|
||||||
stringDate = Jiffy(createdAt.toLocal()).yMd;
|
stringDate = Jiffy.parseFromDateTime(createdAt.toLocal()).yMd;
|
||||||
} else {
|
} else {
|
||||||
stringDate = Jiffy(createdAt.toLocal()).jm;
|
stringDate = Jiffy.parseFromDateTime(createdAt.toLocal()).jm;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Text(
|
return Text(
|
||||||
|
|||||||
+2
-1
@@ -176,11 +176,12 @@ class UserLastActive extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final chatTheme = StreamChatTheme.of(context);
|
final chatTheme = StreamChatTheme.of(context);
|
||||||
|
final lastActive = user.lastActive ?? DateTime.now();
|
||||||
return Text(
|
return Text(
|
||||||
user.online
|
user.online
|
||||||
? context.translations.userOnlineText
|
? context.translations.userOnlineText
|
||||||
: '${context.translations.userLastOnlineText} '
|
: '${context.translations.userLastOnlineText} '
|
||||||
'${Jiffy(user.lastActive).fromNow()}',
|
'${Jiffy.parseFromDateTime(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),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -165,9 +165,9 @@ class StreamChatState extends State<StreamChat> {
|
|||||||
@override
|
@override
|
||||||
void didChangeDependencies() {
|
void didChangeDependencies() {
|
||||||
final currentLocale = Localizations.localeOf(context).toString();
|
final currentLocale = Localizations.localeOf(context).toString();
|
||||||
final availableLocales = Jiffy.getAllAvailableLocales();
|
final availableLocales = Jiffy.getSupportedLocales();
|
||||||
if (availableLocales.contains(currentLocale)) {
|
if (availableLocales.contains(currentLocale)) {
|
||||||
Jiffy.locale(currentLocale);
|
Jiffy.setLocale(currentLocale);
|
||||||
}
|
}
|
||||||
super.didChangeDependencies();
|
super.didChangeDependencies();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
|||||||
/// [StreamChatTheme].
|
/// [StreamChatTheme].
|
||||||
/// Modify it to change the widget's appearance.
|
/// Modify it to change the widget's appearance.
|
||||||
/// {@endtemplate}
|
/// {@endtemplate}
|
||||||
|
@Deprecated('Use `StreamUserListTile` instead.')
|
||||||
class StreamUserItem extends StatelessWidget {
|
class StreamUserItem extends StatelessWidget {
|
||||||
/// {@macro streamUserItem}
|
/// {@macro streamUserItem}
|
||||||
const StreamUserItem({
|
const StreamUserItem({
|
||||||
@@ -73,11 +74,12 @@ class StreamUserItem extends StatelessWidget {
|
|||||||
|
|
||||||
Widget _buildLastActive(BuildContext context) {
|
Widget _buildLastActive(BuildContext context) {
|
||||||
final chatTheme = StreamChatTheme.of(context);
|
final chatTheme = StreamChatTheme.of(context);
|
||||||
|
final lastActive = user.lastActive ?? DateTime.now();
|
||||||
return Text(
|
return Text(
|
||||||
user.online
|
user.online
|
||||||
? context.translations.userOnlineText
|
? context.translations.userOnlineText
|
||||||
: '${context.translations.userLastOnlineText} '
|
: '${context.translations.userLastOnlineText} '
|
||||||
'${Jiffy(user.lastActive).fromNow()}',
|
'${Jiffy.parseFromDateTime(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),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ dependencies:
|
|||||||
http_parser: ^4.0.0
|
http_parser: ^4.0.0
|
||||||
image_gallery_saver: ^2.0.1
|
image_gallery_saver: ^2.0.1
|
||||||
image_picker: ">=0.8.2 <2.0.0"
|
image_picker: ">=0.8.2 <2.0.0"
|
||||||
jiffy: ^5.0.0
|
jiffy: ^6.2.1
|
||||||
lottie: ^2.0.0
|
lottie: ^2.0.0
|
||||||
meta: ^1.8.0
|
meta: ^1.8.0
|
||||||
path_provider: ^2.0.9
|
path_provider: ^2.0.9
|
||||||
|
|||||||
Reference in New Issue
Block a user