Cretezy / flutter_linkify

Turns text URLs and emails into clickable inline links in text for Flutter
https://pub.dartlang.org/packages/flutter_linkify
MIT License
262 stars 99 forks source link

examples and API doco out of date #112

Open abulka opened 1 year ago

abulka commented 1 year ago

I installed 5.0.2 and the readme examples and API doco uses deprecated calls canLaunch and launch. E.g. the example

Future<void> _onOpen(LinkableElement link) async {
  if (await canLaunch(link.url)) {
    await launch(link.url);
  } else {
    throw 'Could not launch $link';
  }
}

should be something like:

Future<void> _onOpen(LinkableElement link) async {
  final Uri url = Uri.parse(link.url);
  if (await canLaunchUrl(url)) {
    await launchUrl(url);
  } else {
    throw 'Could not launch $link';
  }
}

This is pretty confusing for newcomers to this project.