feat: invitations to show the real phone number after accepting the invitation
This commit is contained in:
parent
766a2d8f28
commit
3b50c997fa
@ -183,6 +183,7 @@ public class InvitationResponse {
|
|||||||
private Long id;
|
private Long id;
|
||||||
private String displayName;
|
private String displayName;
|
||||||
private String avatar;
|
private String avatar;
|
||||||
|
private String phoneNumber;
|
||||||
private LocalDateTime joinedAt;
|
private LocalDateTime joinedAt;
|
||||||
|
|
||||||
public AttendeeDto() {}
|
public AttendeeDto() {}
|
||||||
@ -211,6 +212,14 @@ public class InvitationResponse {
|
|||||||
this.avatar = avatar;
|
this.avatar = avatar;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getPhoneNumber() {
|
||||||
|
return phoneNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPhoneNumber(String phoneNumber) {
|
||||||
|
this.phoneNumber = phoneNumber;
|
||||||
|
}
|
||||||
|
|
||||||
public LocalDateTime getJoinedAt() {
|
public LocalDateTime getJoinedAt() {
|
||||||
return joinedAt;
|
return joinedAt;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -240,6 +240,7 @@ public class InvitationService {
|
|||||||
dto.setId(attendee.getUser().getId());
|
dto.setId(attendee.getUser().getId());
|
||||||
dto.setDisplayName(attendee.getUser().getDisplayName());
|
dto.setDisplayName(attendee.getUser().getDisplayName());
|
||||||
dto.setAvatar(attendee.getUser().getAvatar());
|
dto.setAvatar(attendee.getUser().getAvatar());
|
||||||
|
dto.setPhoneNumber(attendee.getUser().getPhoneNumber());
|
||||||
dto.setJoinedAt(attendee.getJoinedAt());
|
dto.setJoinedAt(attendee.getJoinedAt());
|
||||||
return dto;
|
return dto;
|
||||||
})
|
})
|
||||||
|
|||||||
@ -34,11 +34,13 @@ class InvitationCreator {
|
|||||||
final int id;
|
final int id;
|
||||||
final String displayName;
|
final String displayName;
|
||||||
final String? avatar;
|
final String? avatar;
|
||||||
|
final String? phoneNumber;
|
||||||
|
|
||||||
InvitationCreator({
|
InvitationCreator({
|
||||||
required this.id,
|
required this.id,
|
||||||
required this.displayName,
|
required this.displayName,
|
||||||
this.avatar,
|
this.avatar,
|
||||||
|
this.phoneNumber,
|
||||||
});
|
});
|
||||||
|
|
||||||
factory InvitationCreator.fromJson(Map<String, dynamic> json) {
|
factory InvitationCreator.fromJson(Map<String, dynamic> json) {
|
||||||
@ -46,6 +48,7 @@ class InvitationCreator {
|
|||||||
id: json['id'],
|
id: json['id'],
|
||||||
displayName: json['displayName'],
|
displayName: json['displayName'],
|
||||||
avatar: json['avatar'],
|
avatar: json['avatar'],
|
||||||
|
phoneNumber: json['phoneNumber'],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,6 +57,7 @@ class InvitationCreator {
|
|||||||
'id': id,
|
'id': id,
|
||||||
'displayName': displayName,
|
'displayName': displayName,
|
||||||
'avatar': avatar,
|
'avatar': avatar,
|
||||||
|
'phoneNumber': phoneNumber,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -63,12 +67,14 @@ class InvitationAttendee {
|
|||||||
final String displayName;
|
final String displayName;
|
||||||
final String? avatar;
|
final String? avatar;
|
||||||
final DateTime joinedAt;
|
final DateTime joinedAt;
|
||||||
|
final String? phoneNumber;
|
||||||
|
|
||||||
InvitationAttendee({
|
InvitationAttendee({
|
||||||
required this.id,
|
required this.id,
|
||||||
required this.displayName,
|
required this.displayName,
|
||||||
this.avatar,
|
this.avatar,
|
||||||
required this.joinedAt,
|
required this.joinedAt,
|
||||||
|
this.phoneNumber,
|
||||||
});
|
});
|
||||||
|
|
||||||
factory InvitationAttendee.fromJson(Map<String, dynamic> json) {
|
factory InvitationAttendee.fromJson(Map<String, dynamic> json) {
|
||||||
@ -77,6 +83,7 @@ class InvitationAttendee {
|
|||||||
displayName: json['displayName'],
|
displayName: json['displayName'],
|
||||||
avatar: json['avatar'],
|
avatar: json['avatar'],
|
||||||
joinedAt: DateTime.parse(json['joinedAt']),
|
joinedAt: DateTime.parse(json['joinedAt']),
|
||||||
|
phoneNumber: json['phoneNumber'],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,6 +93,7 @@ class InvitationAttendee {
|
|||||||
'displayName': displayName,
|
'displayName': displayName,
|
||||||
'avatar': avatar,
|
'avatar': avatar,
|
||||||
'joinedAt': joinedAt.toIso8601String(),
|
'joinedAt': joinedAt.toIso8601String(),
|
||||||
|
'phoneNumber': phoneNumber,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,8 +6,7 @@ import '../../utils/invitation_utils.dart';
|
|||||||
import '../../widgets/whatsapp_button.dart';
|
import '../../widgets/whatsapp_button.dart';
|
||||||
|
|
||||||
// WhatsApp configuration
|
// WhatsApp configuration
|
||||||
const String _whatsappNumber = 'PHONE_NUMBER';
|
const bool _showWhatsappButton = true;
|
||||||
const bool _showWhatsappButton = true; // Set to false for production
|
|
||||||
|
|
||||||
class InvitationDetailsPage extends StatefulWidget {
|
class InvitationDetailsPage extends StatefulWidget {
|
||||||
final int invitationId;
|
final int invitationId;
|
||||||
@ -545,10 +544,12 @@ class _InvitationDetailsPageState extends State<InvitationDetailsPage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
if ((widget.isOwner || _isCurrentlyParticipant) &&
|
if ((widget.isOwner || _isCurrentlyParticipant) &&
|
||||||
_showWhatsappButton) ...[
|
_showWhatsappButton &&
|
||||||
|
_invitationDetails!.creator.phoneNumber != null &&
|
||||||
|
_invitationDetails!.creator.phoneNumber!.isNotEmpty) ...[
|
||||||
SizedBox(width: 8),
|
SizedBox(width: 8),
|
||||||
WhatsAppButton(
|
WhatsAppButton(
|
||||||
phoneNumber: _whatsappNumber,
|
phoneNumber: _invitationDetails!.creator.phoneNumber!,
|
||||||
size: 28,
|
size: 28,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -633,10 +634,12 @@ class _InvitationDetailsPageState extends State<InvitationDetailsPage> {
|
|||||||
),
|
),
|
||||||
if ((widget.isOwner ||
|
if ((widget.isOwner ||
|
||||||
_isCurrentlyParticipant) &&
|
_isCurrentlyParticipant) &&
|
||||||
_showWhatsappButton) ...[
|
_showWhatsappButton &&
|
||||||
|
attendee.phoneNumber != null &&
|
||||||
|
attendee.phoneNumber!.isNotEmpty) ...[
|
||||||
SizedBox(width: 8),
|
SizedBox(width: 8),
|
||||||
WhatsAppButton(
|
WhatsAppButton(
|
||||||
phoneNumber: _whatsappNumber,
|
phoneNumber: attendee.phoneNumber!,
|
||||||
size: 24,
|
size: 24,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user