diff --git a/lib/clients/notification_client.dart b/lib/clients/notification_client.dart index 5f0823d..95ba0fe 100644 --- a/lib/clients/notification_client.dart +++ b/lib/clients/notification_client.dart @@ -78,7 +78,7 @@ class NotificationClient { } return fln.Message( content, - message.sendTime, + message.sendTime.toLocal(), fln.Person( name: uname, bot: false, diff --git a/lib/main.dart b/lib/main.dart index bfcdf71..fc84aa7 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -92,7 +92,7 @@ class _ContactsPlusPlusState extends State { return; } - if (remoteSem > currentSem && navigator.overlay?.context != null) { + if (remoteSem > currentSem && navigator.overlay?.context != null && context.mounted) { showDialog( context: navigator.overlay!.context, builder: (context) { diff --git a/lib/models/message.dart b/lib/models/message.dart index fa9f7ea..9357d74 100644 --- a/lib/models/message.dart +++ b/lib/models/message.dart @@ -49,8 +49,8 @@ class Message implements Comparable { final MessageState state; Message({required this.id, required this.recipientId, required this.senderId, required this.type, - required this.content, required this.sendTime, this.state=MessageState.local}) - : formattedContent = FormatNode.fromText(content); + required this.content, required DateTime sendTime, this.state=MessageState.local}) + : formattedContent = FormatNode.fromText(content), sendTime = sendTime.toUtc(); factory Message.fromMap(Map map, {MessageState? withState}) { final typeString = (map["messageType"] as String?) ?? ""; @@ -105,7 +105,7 @@ class Message implements Comparable { } @override - int compareTo(other) { + int compareTo(covariant Message other) { return other.sendTime.compareTo(sendTime); } } diff --git a/lib/widgets/friends/friends_list.dart b/lib/widgets/friends/friends_list.dart index f7d50a6..f4591e9 100644 --- a/lib/widgets/friends/friends_list.dart +++ b/lib/widgets/friends/friends_list.dart @@ -6,7 +6,6 @@ import 'package:contacts_plus_plus/clients/messaging_client.dart'; import 'package:contacts_plus_plus/models/friend.dart'; import 'package:contacts_plus_plus/models/personal_profile.dart'; import 'package:contacts_plus_plus/widgets/default_error_widget.dart'; -import 'package:contacts_plus_plus/widgets/formatted_text.dart'; import 'package:contacts_plus_plus/widgets/friends/expanding_input_fab.dart'; import 'package:contacts_plus_plus/widgets/friends/friend_list_tile.dart'; import 'package:contacts_plus_plus/widgets/my_profile_dialog.dart'; diff --git a/lib/widgets/friends/user_search.dart b/lib/widgets/friends/user_search.dart index ae8c8ab..89d1442 100644 --- a/lib/widgets/friends/user_search.dart +++ b/lib/widgets/friends/user_search.dart @@ -88,8 +88,8 @@ class _UserSearchState extends State { return DefaultErrorWidget(title: "${snapshot.error}",); } } else { - return Column( - children: const [ + return const Column( + children: [ LinearProgressIndicator(), ], ); diff --git a/lib/widgets/messages/message_asset.dart b/lib/widgets/messages/message_asset.dart index 72c3ebb..489cc81 100644 --- a/lib/widgets/messages/message_asset.dart +++ b/lib/widgets/messages/message_asset.dart @@ -10,7 +10,6 @@ import 'package:contacts_plus_plus/string_formatter.dart'; import 'package:contacts_plus_plus/widgets/formatted_text.dart'; import 'package:contacts_plus_plus/widgets/messages/message_state_indicator.dart'; import 'package:flutter/material.dart'; -import 'package:full_screen_image/full_screen_image.dart'; import 'package:intl/intl.dart'; import 'package:photo_view/photo_view.dart'; @@ -76,7 +75,7 @@ class MessageAsset extends StatelessWidget { Padding( padding: const EdgeInsets.symmetric(horizontal: 4.0), child: Text( - _dateFormat.format(message.sendTime), + _dateFormat.format(message.sendTime.toLocal()), style: Theme .of(context) .textTheme diff --git a/lib/widgets/messages/message_audio_player.dart b/lib/widgets/messages/message_audio_player.dart index 632e512..488b5c8 100644 --- a/lib/widgets/messages/message_audio_player.dart +++ b/lib/widgets/messages/message_audio_player.dart @@ -148,7 +148,7 @@ class _MessageAudioPlayerState extends State { Padding( padding: const EdgeInsets.symmetric(horizontal: 4.0), child: Text( - _dateFormat.format(widget.message.sendTime), + _dateFormat.format(widget.message.sendTime.toLocal()), style: Theme .of(context) .textTheme diff --git a/lib/widgets/messages/message_bubble.dart b/lib/widgets/messages/message_bubble.dart index d27d7cc..a4d7d1d 100644 --- a/lib/widgets/messages/message_bubble.dart +++ b/lib/widgets/messages/message_bubble.dart @@ -100,7 +100,7 @@ class MyMessageBubble extends StatelessWidget { Padding( padding: const EdgeInsets.symmetric(horizontal: 4.0), child: Text( - _dateFormat.format(message.sendTime), + _dateFormat.format(message.sendTime.toLocal()), style: Theme .of(context) .textTheme @@ -227,7 +227,7 @@ class OtherMessageBubble extends StatelessWidget { ), const SizedBox(height: 6,), Text( - _dateFormat.format(message.sendTime), + _dateFormat.format(message.sendTime.toLocal()), style: Theme .of(context) .textTheme diff --git a/lib/widgets/messages/message_session_invite.dart b/lib/widgets/messages/message_session_invite.dart index 02541e7..327bb06 100644 --- a/lib/widgets/messages/message_session_invite.dart +++ b/lib/widgets/messages/message_session_invite.dart @@ -67,7 +67,7 @@ class MessageSessionInvite extends StatelessWidget { Padding( padding: const EdgeInsets.symmetric(horizontal: 4.0), child: Text( - _dateFormat.format(message.sendTime), + _dateFormat.format(message.sendTime.toLocal()), style: Theme .of(context) .textTheme diff --git a/pubspec.lock b/pubspec.lock index ca995ce..0337cfb 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -264,14 +264,6 @@ packages: description: flutter source: sdk version: "0.0.0" - full_screen_image: - dependency: "direct main" - description: - name: full_screen_image - sha256: "97831b00d07b17c674ba3a4eddcee306dbd0d7c66851f1b67856e12daeb9b3aa" - url: "https://pub.dev" - source: hosted - version: "2.0.0" html: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 8bdd4f0..58534f4 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 1.2.0+1 +version: 1.2.1+1 environment: sdk: '>=3.0.0' @@ -53,7 +53,6 @@ dependencies: collection: ^1.17.0 package_info_plus: ^3.1.2 provider: ^6.0.5 - full_screen_image: ^2.0.0 photo_view: ^0.14.0 color: ^3.0.0