launchLinkExternal method
Implementation
Future<void> launchLinkExternal(
String url, {
String? title,
String? description,
String? buttonText,
String? closeButtonText,
Function? extraOnConfirmFunction,
}) async {
AlertResponse exit = await (_dialogService.showDialog(
BasicDialog(
title: title ?? "You're about to leave",
description: description ??
"This link will take you out of the app. Are you sure you want to go?",
buttons: <DialogButton>[
DialogButton(
text: buttonText ?? "Let's go",
response: true,
),
DialogButton(
text: closeButtonText ?? "Close",
response: false,
style: DarkButtonStyle.Secondary,
),
]),
) as Future<AlertResponse>);
if (exit.response) {
if (extraOnConfirmFunction != null) {
extraOnConfirmFunction();
}
await urlLauncher.openUrl(Uri.parse(url));
}
}