LinkTextSpan constructor

LinkTextSpan({
  1. required Link link,
  2. required BuildContext context,
  3. VoidCallback? onTap,
  4. VoidCallback? onLaunchUrlError,
  5. TextStyle? style,
})

Implementation

LinkTextSpan({
  required Link link,
  required BuildContext context,
  VoidCallback? onTap,
  VoidCallback? onLaunchUrlError,
  TextStyle? style,
}) : super(
        text: link.display,
        style: style ?? Theme.of(context).linkTextStyle,
        recognizer: TapGestureRecognizer()
          ..onTap = () async {
            onTap?.call();
            await launchUrl(link.url, onError: onLaunchUrlError);
          },
      );