diff --git a/lib/widgets/contactrow.dart b/lib/widgets/contactrow.dart index 18c750dc..140e3703 100644 --- a/lib/widgets/contactrow.dart +++ b/lib/widgets/contactrow.dart @@ -1,3 +1,5 @@ +import 'dart:io'; + import 'package:cwtch/views/contactsview.dart'; import 'package:flutter/material.dart'; import 'package:flutter/painting.dart'; @@ -127,9 +129,9 @@ class _ContactRowState extends State { } // If the last message was over a day ago, just state the date if (DateTime.now().difference(date).inDays > 1) { - return DateFormat.yMd().format(date.toLocal()); + return DateFormat.yMd(Platform.localeName).format(date.toLocal()); } // Otherwise just state the time. - return DateFormat.Hm().format(date.toLocal()); + return DateFormat.Hm(Platform.localeName).format(date.toLocal()); } } diff --git a/lib/widgets/invitationbubble.dart b/lib/widgets/invitationbubble.dart index 4770283d..9214fd69 100644 --- a/lib/widgets/invitationbubble.dart +++ b/lib/widgets/invitationbubble.dart @@ -1,4 +1,5 @@ import 'dart:convert'; +import 'dart:io'; import 'package:cwtch/cwtch_icons_icons.dart'; import 'package:cwtch/models/message.dart'; @@ -39,7 +40,7 @@ class InvitationBubbleState extends State { var borderRadiousEh = 15.0; var showGroupInvite = Provider.of(context).isExperimentEnabled(TapirGroupsExperiment); rejected = Provider.of(context).flags & 0x01 == 0x01; - var prettyDate = DateFormat.yMd().add_jm().format(Provider.of(context).timestamp); + var prettyDate = DateFormat.yMd(Platform.localeName).add_jm().format(Provider.of(context).timestamp); // If the sender is not us, then we want to give them a nickname... var senderDisplayStr = ""; diff --git a/lib/widgets/messagebubble.dart b/lib/widgets/messagebubble.dart index 094e0ff9..2ba8fe0c 100644 --- a/lib/widgets/messagebubble.dart +++ b/lib/widgets/messagebubble.dart @@ -1,3 +1,5 @@ +import 'dart:io'; + import 'package:cwtch/models/message.dart'; import 'package:cwtch/widgets/malformedbubble.dart'; import 'package:flutter/material.dart'; @@ -28,7 +30,7 @@ class MessageBubbleState extends State { // var myKey = Provider.of(context).profileOnion + "::" + Provider.of(context).contactHandle + "::" + Provider.of(context).messageIndex.toString(); DateTime messageDate = Provider.of(context).timestamp; - prettyDate = DateFormat.yMd().add_jm().format(messageDate.toLocal()); + prettyDate = DateFormat.yMd(Platform.localeName).add_jm().format(messageDate.toLocal()); // If the sender is not us, then we want to give them a nickname... var senderDisplayStr = ""; diff --git a/pubspec.lock b/pubspec.lock index 2ee3b476..b8117b89 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -21,7 +21,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.7.0" + version: "2.8.1" boolean_selector: dependency: transitive description: @@ -181,7 +181,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.4.0" + version: "1.7.0" msix: dependency: "direct dev" description: @@ -329,6 +329,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "5.0.0" + scrollable_positioned_list: + dependency: "direct main" + description: + name: scrollable_positioned_list + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.0-nullsafety.0" sky_engine: dependency: transitive description: flutter @@ -375,7 +382,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.1" + version: "0.4.2" typed_data: dependency: transitive description: