Fix for commit 210cfd85

master
Rafael 2024-06-17 15:37:59 +02:00
parent 210cfd85bd
commit 0eeba51d46
1 changed files with 4 additions and 4 deletions

View File

@ -9,7 +9,7 @@ import '../utils/math.dart';
class UserTileLikes extends StatefulWidget { class UserTileLikes extends StatefulWidget {
final DocumentSnapshot user; final DocumentSnapshot user;
final bool hasMatch; final bool hasMatch;
final UserProfile currentUser; final UserProfile? currentUser;
final VoidCallback onUnlike; final VoidCallback onUnlike;
final VoidCallback onShowChat; final VoidCallback onShowChat;
final VoidCallback onViewInfo; final VoidCallback onViewInfo;
@ -18,7 +18,7 @@ class UserTileLikes extends StatefulWidget {
super.key, super.key,
required this.user, required this.user,
required this.hasMatch, required this.hasMatch,
required this.currentUser, this.currentUser,
required this.onUnlike, required this.onUnlike,
required this.onShowChat, required this.onShowChat,
required this.onViewInfo, required this.onViewInfo,
@ -58,8 +58,8 @@ class _UserTileLikesState extends State<UserTileLikes> {
bool hasName = userMap.containsKey(Constants.dbFieldUsersName); bool hasName = userMap.containsKey(Constants.dbFieldUsersName);
bool hasBio = userMap.containsKey(Constants.dbFieldUsersBio); bool hasBio = userMap.containsKey(Constants.dbFieldUsersBio);
String? shortDist = (_otherUser != null String? shortDist = (_otherUser != null && widget.currentUser != null
? shortestDistanceBetweenUsers(widget.currentUser, _otherUser!) ? shortestDistanceBetweenUsers(widget.currentUser!, _otherUser!)
.toStringAsFixed(0) .toStringAsFixed(0)
: null); : null);