onPressed method
Implementation
Function()? onPressed(
ParticipantType? userType,
WidgetRef ref,
String uid,
ParticipantType type,
) {
if (userType == type) return null;
return () {
// Launch sign up form if it exists and the button for going is pressed
if (type == ParticipantType.going &&
signUpForm != null &&
signUpForm!.isNotEmpty) {
launchUrl(Uri.parse(signUpForm!), mode: LaunchMode.externalApplication);
}
ref
.read(participantProvider(eventID).notifier)
.addUserToParticipants(uid, type);
};
}