build: Update matrix dart sdk to 0.40.0

Signed-off-by: Christian Kußowski <c.kussowski@famedly.com>
This commit is contained in:
Christian Kußowski 2025-05-09 12:55:40 +02:00
commit 8664f21ad8
No known key found for this signature in database
GPG key ID: E067ECD60F1A0652
10 changed files with 53 additions and 159 deletions

View file

@ -1,4 +1,5 @@
import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:intl/intl.dart';
import 'package:matrix/matrix.dart';
/// This is a temporary helper class until there is a proper solution to this with the new system
@ -350,4 +351,21 @@ class MatrixLocals extends MatrixLocalizations {
@override
String get cancelledSend => l10n.sendCanceled;
@override
String voiceMessage(String senderName, Duration? duration) {
final dateTime = duration == null
? null
: DateTime.fromMillisecondsSinceEpoch(
duration.inSeconds * 1000,
);
final formattedDuration = dateTime == null
? ''
: DateFormat(
DateFormat.MINUTE_SECOND,
l10n.localeName,
).format(dateTime);
return l10n.sentVoiceMessage(senderName, formattedDuration);
}
}