diff --git a/lib/src/linkify.dart b/lib/src/linkify.dart index 3d1f9c8..6241c27 100644 --- a/lib/src/linkify.dart +++ b/lib/src/linkify.dart @@ -132,7 +132,7 @@ class LinkifyText extends StatelessWidget { final Map? customLinkStyles; - final Map? linkifyListCallBack; + final Map? linkifyListCallBack; @override Widget build(BuildContext context) { @@ -378,7 +378,7 @@ TextSpan _linkify({ List? linkTypes, Map? customLinkStyles, Function(Link)? onTap, - Map? mapReplace, + Map? mapReplace, }) { final _regExp = constructRegExpFromLinkType(linkTypes ?? [LinkType.url]); @@ -399,7 +399,9 @@ TextSpan _linkify({ // add the link spans.add( TextSpan( - text:( mapReplace?[link.value??'']?.isNotEmpty??false) ? (mapReplace?[link.value??''] ??'' ): link.value, + text: (mapReplace?[link.value ?? '']?.isNotEmpty ?? false) + ? (mapReplace?[link.value ?? ''] ?? '') + : link.value, style: customLinkStyles?[link.type] ?? linkStyle, recognizer: TapGestureRecognizer() ..onTap = () { @@ -407,10 +409,8 @@ TextSpan _linkify({ }, ), ); - } } - return TextSpan(children: spans); }